diff --git a/modules/node/node.module b/modules/node/node.module
index 57133c6..420a007 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1029,6 +1029,13 @@ function node_submit($node) {
  *   omitted (or $node->is_new is TRUE), a new node will be added.
  */
 function node_save($node) {
+  // Locking the node save operation makes it atomic. This way, if Drupal tries
+  // to update a node via node_save without going through the form validation
+  // process, the operation won't ovewrite other threads operations on the node.
+  $lock_name = 'node_save:' . $node->nid;
+  if (!lock_acquire($lock_name)) {
+    throw new Exception(t("@type could not be saved. Another task is performing operations on it.", array('@type' => node_type_get_name($node->type))));
+  }
   $transaction = db_transaction();
 
   try {
@@ -1148,9 +1155,11 @@ function node_save($node) {
     // Ignore slave server temporarily to give time for the
     // saved node to be propagated to the slave.
     db_ignore_slave();
+    lock_release($lock_name);
   }
   catch (Exception $e) {
     $transaction->rollback();
+    lock_release($lock_name);
     watchdog_exception('node', $e);
     throw $e;
   }
