Skip to content

Commit ea6cae6

Browse files
authored
Make waiting on condition variables error out on SWIFT_STDLIB_SINGLE_THREADED_RUNTIME (swiftlang#33788)
1 parent 41f1285 commit ea6cae6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/swift/Runtime/MutexSingleThreaded.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#ifndef SWIFT_RUNTIME_MUTEX_SINGLE_THREADED_H
1818
#define SWIFT_RUNTIME_MUTEX_SINGLE_THREADED_H
1919

20+
#include "swift/Runtime/Debug.h"
21+
2022
namespace swift {
2123

2224
typedef void* ConditionHandle;
@@ -35,7 +37,9 @@ struct ConditionPlatformHelper {
3537
static void destroy(ConditionHandle &condition) {}
3638
static void notifyOne(ConditionHandle &condition) {}
3739
static void notifyAll(ConditionHandle &condition) {}
38-
static void wait(ConditionHandle &condition, MutexHandle &mutex);
40+
static void wait(ConditionHandle &condition, MutexHandle &mutex) {
41+
fatalError(0, "single-threaded runtime cannot wait for condition");
42+
}
3943
};
4044

4145
struct MutexPlatformHelper {

0 commit comments

Comments
 (0)