diff mbox

[trans-mem] missing case in rwlock::write_upgrade

Message ID 4D6E4E62.7030008@unine.ch
State New
Headers show

Commit Message

Patrick Marlier March 2, 2011, 2:04 p.m. UTC
In libitm, a specific case is missing in rwlock::write_upgrade. Indeed, 
if there is no concurrent active reader while upgrading the lock, we 
have to unset the a_reader bit (we were the only reader).

Patrick Marlier.

libitm/
	* config/posix/rwlock.cc (write_upgrade): Add missing case.

Comments

Richard Henderson March 2, 2011, 10:28 p.m. UTC | #1
On 03/03/2011 12:04 AM, Patrick Marlier wrote:
>     * config/posix/rwlock.cc (write_upgrade): Add missing case.

Applied.


r~
diff mbox

Patch

Index: libitm/config/posix/rwlock.cc
===================================================================
--- libitm/config/posix/rwlock.cc	(revision 170587)
+++ libitm/config/posix/rwlock.cc	(working copy)
@@ -130,6 +130,11 @@ 
       // We only return from upgrade when we've got it; don't loop.
       assert ((sum & (a_reader | a_writer)) == 0);
     }
+  else
+    {
+      // We were the only reader.
+      sum &= ~a_reader;
+    }
 
   // Otherwise we can upgrade to writer.
   this->summary = sum | a_writer;