mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
695c24f493
Summary: These don't compile on Windows, and in order to get mode/win to compile, we need to avoid compiling their contents. Ideally, we could do that in the TARGETS files with the select statement, but that's not available in fbcode. Thus, we do the next best thing: ifdef the file entirely. Reviewed By: wez Differential Revision: D23871728 fbshipit-source-id: b4d9df6503eaa008e649afd7bdc665cd37a9585d
27 lines
537 B
C++
27 lines
537 B
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its 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 {
|
|
namespace eden {
|
|
|
|
void disablePthreadCancellation() {
|
|
int oldstate;
|
|
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldstate);
|
|
int oldtype;
|
|
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
|
|
}
|
|
|
|
} // namespace eden
|
|
} // namespace facebook
|
|
|
|
#endif
|