mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 06:47:41 +03:00
9fa292b9ed
Reviewed By: genevievehelsel Differential Revision: D36429182 fbshipit-source-id: 7d355917abf463493c37139856810de13e1090ff
25 lines
514 B
C++
25 lines
514 B
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This software may be used and distributed according to the terms of the
|
|
* GNU General Public License version 2.
|
|
*/
|
|
|
|
#ifndef _WIN32
|
|
|
|
#include "eden/fs/utils/Thread.h"
|
|
#include <pthread.h>
|
|
|
|
namespace facebook::eden {
|
|
|
|
void disablePthreadCancellation() {
|
|
int oldstate;
|
|
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldstate);
|
|
int oldtype;
|
|
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
|
|
}
|
|
|
|
} // namespace facebook::eden
|
|
|
|
#endif
|