Skip to content

Commit 06de3b2

Browse files
committed
Change spinlock scoping
1 parent 934179a commit 06de3b2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/coreclr/pal/src/thread/threadsusp.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,18 @@ suspension mutex or spinlock. The downside is that it restricts us to only
5050
performing one suspension or resumption in the PAL at a time. */
5151
#ifdef USE_GLOBAL_LOCK_FOR_SUSPENSION
5252

53+
namespace
54+
{
55+
LONG g_ssSuspensionLock = 0;
56+
}
57+
#endif
58+
5359
#define SYNCSPINLOCK_F_ASYMMETRIC 1
5460

5561
#define SPINLOCKInit(lock) (*(lock) = 0)
5662

5763
namespace
5864
{
59-
LONG g_ssSuspensionLock = 0;
60-
6165
/* Basic spinlock implementation */
6266
void SPINLOCKAcquire (LONG * lock, unsigned int flags)
6367
{
@@ -94,9 +98,7 @@ namespace
9498
return InterlockedCompareExchange(lock, 1, 0);
9599
// only returns 0 or 1.
96100
}
97-
98101
}
99-
#endif
100102

101103
/*++
102104
Function:

0 commit comments

Comments
 (0)