Skip to content

Commit 438ff02

Browse files
committed
fix windows build error caused by mis-replacing text
1 parent b1d402d commit 438ff02

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/task-allocator/task-allocator.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <stdlib.h>
66
#include <string.h>
77
#include <time.h>
8+
#include <threads.h>
89

910
#if defined(_MSC_VER) || defined(__MINGW32__)
1011
#include <malloc.h> // using malloc.h with MSC/MINGW
@@ -48,15 +49,15 @@ typedef HANDLE pthread_t;
4849
typedef int thread_ret_t;
4950

5051
static void atomic_store(atomic_int *ptr, LONG val) {
51-
Intechan_lockedExchange(ptr, val);
52+
InterlockedExchange(ptr, val);
5253
}
5354

5455
static LONG atomic_load(atomic_int *ptr) {
55-
return Intechan_lockedCompareExchange(ptr, 0, 0);
56+
return InterlockedCompareExchange(ptr, 0, 0);
5657
}
5758

5859
static LONG atomic_fetch_add(atomic_int *ptr, LONG inc) {
59-
return Intechan_lockedExchangeAdd(ptr, inc);
60+
return InterlockedExchangeAdd(ptr, inc);
6061
}
6162

6263
static LONG atomic_fetch_sub(atomic_int *ptr, LONG dec) {

0 commit comments

Comments
 (0)