1 #include "bcwindowbase.inc"
4 #include "removethread.h"
10 #include <uuid/uuid.h>
15 RemoveThread::RemoveThread()
18 input_lock = new Condition(0, "RemoveThread::input_lock", 0);
19 file_lock = new Mutex("RemoveThread::file_lock");
22 void RemoveThread::remove_file(char *path)
24 // Rename to temporary
27 char string[BCTEXTLEN];
29 uuid_unparse(id, string + strlen(string));
31 printf("RemoveThread::run: renaming %s -> %s\n", path, string);
33 file_lock->lock("RemoveThread::remove_file");
34 files.append(strdup(string));
39 void RemoveThread::create_objects()
44 void RemoveThread::run()
48 char string[BCTEXTLEN];
50 input_lock->lock("RemoveThread::run");
51 file_lock->lock("RemoveThread::remove_file");
54 strcpy(string, files.values[0]);
55 files.remove_object_number(0);
60 printf("RemoveThread::run: deleting %s\n", string);