Skip to content

Commit b1366a8

Browse files
committed
[Bug 16619] Add int cast operator to MCSemaphore.
Enables extracting the current log depth from an `MCSemaphore` exactly as if it was just an integer.
1 parent cb8a26c commit b1366a8

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

engine/src/mcsemaphore.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ class MCSemaphore
6464
return IsLocked();
6565
}
6666

67+
/* Automatic extraction of the wait depth */
68+
operator int() const
69+
{
70+
return m_counter;
71+
}
72+
6773
/* ---------- Locking ops */
6874
void Lock()
6975
{

0 commit comments

Comments
 (0)