Index: django/db/models/base.py
===================================================================
--- django/db/models/base.py	(revision 7364)
+++ django/db/models/base.py	(working copy)
@@ -6,7 +6,7 @@
 from django.db.models.fields.related import OneToOneRel, ManyToOneRel
 from django.db.models.query import delete_objects
 from django.db.models.options import Options, AdminOptions
-from django.db import connection, transaction
+from django.db import connection, transaction, mutex
 from django.db.models import signals
 from django.db.models.loading import register_models, get_model
 from django.dispatch import dispatcher
@@ -275,6 +275,7 @@
         dispatcher.send(signal=signals.post_save, sender=self.__class__,
                         instance=self, created=(not record_exists), raw=raw)
 
+    save = mutex(save)
     save.alters_data = True
 
     def validate(self):
@@ -334,6 +335,7 @@
         # Actually delete the objects
         delete_objects(seen_objs)
 
+    delete = mutex(delete)
     delete.alters_data = True
 
     def _get_FIELD_display(self, field):
Index: django/db/models/fields/related.py
===================================================================
--- django/db/models/fields/related.py	(revision 7364)
+++ django/db/models/fields/related.py	(working copy)
@@ -1,4 +1,4 @@
-from django.db import connection, transaction
+from django.db import connection, transaction, mutex
 from django.db.models import signals, get_model
 from django.db.models.fields import AutoField, Field, IntegerField, PositiveIntegerField, PositiveSmallIntegerField, get_ul_class
 from django.db.models.related import RelatedObject
@@ -254,12 +254,14 @@
                 for obj in objs:
                     setattr(obj, rel_field.name, instance)
                     obj.save()
+            add = mutex(add)
             add.alters_data = True
 
             def create(self, **kwargs):
                 new_obj = self.model(**kwargs)
                 self.add(new_obj)
                 return new_obj
+            create = mutex(create)
             create.alters_data = True
 
             # remove() and clear() are only provided if the ForeignKey can have a value of null.
@@ -273,12 +275,14 @@
                             obj.save()
                         else:
                             raise rel_field.rel.to.DoesNotExist, "%r is not related to %r." % (obj, instance)
+                remove = mutex(remove)
                 remove.alters_data = True
 
                 def clear(self):
                     for obj in self.all():
                         setattr(obj, rel_field.name, None)
                         obj.save()
+                clear = mutex(clear)
                 clear.alters_data = True
 
         manager = RelatedManager()
@@ -325,6 +329,7 @@
             # If this is a symmetrical m2m relation to self, add the mirror entry in the m2m table
             if self.symmetrical:
                 self._add_items(self.target_col_name, self.source_col_name, *objs)
+        add = mutex(add)
         add.alters_data = True
 
         def remove(self, *objs):
@@ -333,6 +338,7 @@
             # If this is a symmetrical m2m relation to self, remove the mirror entry in the m2m table
             if self.symmetrical:
                 self._remove_items(self.target_col_name, self.source_col_name, *objs)
+        remove = mutex(remove)
         remove.alters_data = True
 
         def clear(self):
@@ -341,6 +347,7 @@
             # If this is a symmetrical m2m relation to self, clear the mirror entry in the m2m table
             if self.symmetrical:
                 self._clear_items(self.target_col_name)
+        clear = mutex(clear)
         clear.alters_data = True
 
         def create(self, **kwargs):
@@ -348,6 +355,7 @@
             new_obj.save()
             self.add(new_obj)
             return new_obj
+        create = mutex(create)
         create.alters_data = True
 
         def _add_items(self, source_col_name, target_col_name, *objs):
Index: django/db/models/query.py
===================================================================
--- django/db/models/query.py	(revision 7364)
+++ django/db/models/query.py	(working copy)
@@ -1,5 +1,5 @@
 from django.conf import settings
-from django.db import connection, transaction, IntegrityError
+from django.db import connection, transaction, IntegrityError, mutex
 from django.db.models.fields import DateField, FieldDoesNotExist
 from django.db.models import signals, loading
 from django.dispatch import dispatcher
@@ -273,6 +273,7 @@
         obj = self.model(**kwargs)
         obj.save()
         return obj
+    create = mutex(create)
 
     def get_or_create(self, **kwargs):
         """
@@ -293,6 +294,7 @@
                 return obj, True
             except IntegrityError, e:
                 return self.get(**kwargs), False
+    get_or_create = mutex(get_or_create)
 
     def latest(self, field_name=None):
         """
@@ -354,6 +356,7 @@
 
         # Clear the result cache, in case this QuerySet gets reused.
         self._result_cache = None
+    delete = mutex(delete)
     delete.alters_data = True
 
     ##################################################
Index: django/db/__init__.py
===================================================================
--- django/db/__init__.py	(revision 7364)
+++ django/db/__init__.py	(working copy)
@@ -1,4 +1,5 @@
 import os
+import threading
 from django.conf import settings
 from django.core import signals
 from django.core.exceptions import ImproperlyConfigured
@@ -68,3 +69,17 @@
     from django.db import transaction
     transaction.rollback_unless_managed()
 dispatcher.connect(_rollback_on_exception, signal=signals.got_request_exception)
+
+# Decorate data-modifying db functions to use a threading.RLock
+__lock = threading.RLock()
+def mutex(func):
+    def decorated(*args, **kwargs):
+        __lock.acquire()
+        try:
+            func(*args, **kwargs)
+        except:
+            __lock.release()
+            raise
+        __lock.release()
+    return decorated
+
Index: AUTHORS
===================================================================
--- AUTHORS	(revision 7364)
+++ AUTHORS	(working copy)
@@ -379,6 +379,8 @@
     ymasuda@ethercube.com
     Jarek Zgoda <jarek.zgoda@gmail.com>
     Cheng Zhang
+    Claudio Marinozzi
+    Travis Parker <travis.parker@gmail.com>
 
 A big THANK YOU goes to:
 
