commit 25e588efd05fc3153a756c42c08bdfbfa34b8256
parent 00acbb184d3223ba28505e286842e8b1a869c4a4
Author: Andres Navarro <canavarro82@gmail.com>
Date: Fri, 24 Aug 2012 03:25:23 -0300
Added locking in kgsystem before calling GC (in delete file workaround).
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/kgsystem.c b/src/kgsystem.c
@@ -104,11 +104,12 @@ void delete_file(klisp_State *K)
/* TEMP: this should probably be done in a operating system specific
manner, but this will do for now */
if (remove(kstring_buf(filename))) {
- /* XXX lock? */
/* At least in Windows, this could have failed if there's a dead
(in the gc sense) port still open, should retry once after
doing a complete GC. This isn't ideal but... */
+ klisp_lock(K);
klispC_fullgc(K);
+ klisp_unlock(K);
if (remove(kstring_buf(filename))) {
klispE_throw_errno_with_irritants(K, "remove", 1, filename);
return;