equal
deleted
inserted
replaced
51 Thread* const thread = Thread::current(); |
51 Thread* const thread = Thread::current(); |
52 Thread* const owner = Atomic::load(&_owner); |
52 Thread* const owner = Atomic::load(&_owner); |
53 |
53 |
54 if (owner != thread) { |
54 if (owner != thread) { |
55 _lock.lock(); |
55 _lock.lock(); |
56 Atomic::store(thread, &_owner); |
56 Atomic::store(&_owner, thread); |
57 } |
57 } |
58 |
58 |
59 _count++; |
59 _count++; |
60 } |
60 } |
61 |
61 |
64 assert(_count > 0, "Invalid count"); |
64 assert(_count > 0, "Invalid count"); |
65 |
65 |
66 _count--; |
66 _count--; |
67 |
67 |
68 if (_count == 0) { |
68 if (_count == 0) { |
69 Atomic::store((Thread*)NULL, &_owner); |
69 Atomic::store(&_owner, (Thread*)NULL); |
70 _lock.unlock(); |
70 _lock.unlock(); |
71 } |
71 } |
72 } |
72 } |
73 |
73 |
74 inline bool ZReentrantLock::is_owned() const { |
74 inline bool ZReentrantLock::is_owned() const { |