noxdafox/pebble — pull request #1 by alanjds (2013-12-13 19:18:19+00:00)
Title: Allow easy synchronization of tasks via @synchronized(lock) decorator

This allows synchronization of process/threads via locks this way:

```python
from pebble import synchronized, process, task
import threading, multiprocessing

thread_lock = threading.Lock()
@thread
@synchronized(thread_lock)
def do_job(foo, bar=0):
return foo + bar

process_lock = multiprocessing.Lock()
@process
@synchronized(process_lock)
def do_job(foo, bar=0):
return foo + bar
```

What you think?