Skip to content

Commit a70863f

Browse files
Yangzheng BaiYangzheng Bai
authored andcommitted
Move debug log at unlock function entrance
This may reflect the real unlock state
1 parent b605475 commit a70863f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

benchmarks/lockhammer/core

-40.4 MB
Binary file not shown.

ext/sms/clh_spinlock.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,15 @@ static inline void clh_lock(struct clh_lock *lock, struct clh_node *node, bool u
228228
/* return the previous node as reused node for the next clh_lock() */
229229
static inline struct clh_node* clh_unlock(struct clh_node *node, unsigned long tid)
230230
{
231+
#ifdef DDEBUG
232+
printf("T%lu UNLOCK: node: %llx\n", tid, (long long unsigned int)node);
233+
#endif
231234
/* CLH spinlock: release current node by resetting wait status */
232235
#ifdef USE_DMB
233236
__atomic_thread_fence(__ATOMIC_RELEASE);
234237
__atomic_store_n(&node->wait, 0, __ATOMIC_RELAXED);
235238
#else
236239
__atomic_store_n(&node->wait, 0, __ATOMIC_RELEASE);
237-
#endif
238-
#ifdef DDEBUG
239-
printf("T%lu UNLOCK: node: %llx\n", tid, (long long unsigned int)node);
240240
#endif
241241
return node->prev;
242242
}

0 commit comments

Comments
 (0)