From 8e7c39898188274f86159e2f8d5959edd31bb767 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 11 Aug 2010 13:32:44 +0200 Subject: fixes --- module/FileDatabase.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'module/FileDatabase.py') diff --git a/module/FileDatabase.py b/module/FileDatabase.py index a7d32b125..c89656407 100644 --- a/module/FileDatabase.py +++ b/module/FileDatabase.py @@ -474,16 +474,19 @@ class FileDatabaseBackend(Thread): def new(*args): args[0].lock.acquire() args[0].jobs.put((func, args, 0)) - sleep(0.001) # needed so that no thread takes result of other one + res = args[0].res.get() args[0].lock.release() - return args[0].res.get() + return res + return new def async(func): """use as decorator when function does not return anything and asynchron execution is wanted""" def new(*args): + args[0].lock.acquire() args[0].jobs.put((func, args, 1)) + args[0].lock.release() return True return new -- cgit v1.2.3