Skip to content

Commit 9eb4079

Browse files
authored
Merge pull request #31678 from MaxDesiatov/patch-2
[Runtime] Define WASI MutexPThread macros as 0
2 parents e7f856f + 74158e8 commit 9eb4079

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/swift/Runtime/MutexPThread.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ typedef pthread_cond_t ConditionHandle;
2626
typedef pthread_mutex_t MutexHandle;
2727
typedef pthread_rwlock_t ReadWriteLockHandle;
2828

29-
#if defined(__CYGWIN__) || defined(__ANDROID__) || defined(__HAIKU__)
29+
#if defined(__CYGWIN__) || defined(__ANDROID__) || defined(__HAIKU__) || defined(__wasi__)
3030
// At the moment CYGWIN pthreads implementation doesn't support the use of
3131
// constexpr for static allocation versions. The way they define things
3232
// results in a reinterpret_cast which violates constexpr. Similarly, Android's
3333
// pthread implementation makes use of volatile attributes that prevent it from
34-
// being marked as constexpr.
34+
// being marked as constexpr. WASI currently doesn't support threading/locking at all.
3535
#define SWIFT_CONDITION_SUPPORTS_CONSTEXPR 0
3636
#define SWIFT_MUTEX_SUPPORTS_CONSTEXPR 0
3737
#define SWIFT_READWRITELOCK_SUPPORTS_CONSTEXPR 0

0 commit comments

Comments
 (0)