mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-24 09:21:16 +08:00
Do not join threads during process exit on Windows (#1738)
This commit is contained in:
parent
022eabb734
commit
eda7a7b43e
@ -56,8 +56,16 @@ namespace scheduler {
|
||||
|
||||
/** A singleton scheduler to manage devices, streams, and task execution. */
|
||||
Scheduler& scheduler() {
|
||||
// Leak the scheduler on Windows to avoid joining threads on exit, can be
|
||||
// removed after Visual Studio fixes bug:
|
||||
// https://developercommunity.visualstudio.com/t/1654756
|
||||
#ifdef _WIN32
|
||||
static Scheduler* scheduler = new Scheduler;
|
||||
return *scheduler;
|
||||
#else
|
||||
static Scheduler scheduler;
|
||||
return scheduler;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace scheduler
|
||||
|
Loading…
Reference in New Issue
Block a user