diff --git a/modules/node/node.module b/modules/node/node.module
index 57133c6..348aebb 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1035,6 +1035,14 @@ function node_save($node) {
     // Load the stored entity, if any.
     if (!empty($node->nid) && !isset($node->original)) {
       $node->original = entity_load_unchanged('node', $node->nid);
+
+      // 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))));
+      }
     }
 
     field_attach_presave('node', $node);
@@ -1148,9 +1156,16 @@ function node_save($node) {
     // Ignore slave server temporarily to give time for the
     // saved node to be propagated to the slave.
     db_ignore_slave();
+
+    if (isset($lock_name)) {
+      lock_release($lock_name);
+    }
   }
   catch (Exception $e) {
     $transaction->rollback();
+    if (isset($lock_name)) {
+      lock_release($lock_name);
+    }
     watchdog_exception('node', $e);
     throw $e;
   }
