diff --git a/libc/src/__support/threads/thread.cpp b/libc/src/__support/threads/thread.cpp index dad4f75f092ede..6f6b75be5766d0 100644 --- a/libc/src/__support/threads/thread.cpp +++ b/libc/src/__support/threads/thread.cpp @@ -117,7 +117,9 @@ class ThreadAtExitCallbackMgr { int add_callback(AtExitCallback *callback, void *obj) { cpp::lock_guard lock(mtx); - return callback_list.push_back({callback, obj}); + if (callback_list.push_back({callback, obj})) + return 0; + return -1; } void call() {