aboutsummaryrefslogtreecommitdiff
path: root/src/script/cpp_api/s_server.cpp
diff options
context:
space:
mode:
authorAnton Tsyganenko <anton-tsyganenko@yandex.ru>2013-11-22 11:45:37 +0100
committerWeblate <42@minetest.ru>2013-11-23 17:33:15 +0100
commitd661cb320d092fbd856cb716fc4b48bf77de790c (patch)
treeecda438870399c562d98c2d1e9f015935fa8c141 /src/script/cpp_api/s_server.cpp
parent78f1fcf4506c7a27a1be135ca054085372cf7d6d (diff)
downloadminetest-d661cb320d092fbd856cb716fc4b48bf77de790c.tar.gz
minetest-d661cb320d092fbd856cb716fc4b48bf77de790c.tar.bz2
minetest-d661cb320d092fbd856cb716fc4b48bf77de790c.zip
Translated using Weblate (Russian)
Diffstat (limited to 'src/script/cpp_api/s_server.cpp')
0 files changed, 0 insertions, 0 deletions
s="hl com">IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef THREADING_MUTEX_H #define THREADING_MUTEX_H // Windows std::mutex is much slower than the critical section API #if __cplusplus >= 201103L && !defined(_WIN32) #include <mutex> using Mutex = std::mutex; using RecursiveMutex = std::recursive_mutex; #else #ifdef _WIN32 #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0501 #endif #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include <windows.h> #else // pthread #include <pthread.h> #endif #include "util/basic_macros.h" class Mutex { public: Mutex(); ~Mutex(); void lock(); void unlock(); protected: Mutex(bool recursive); void init_mutex(bool recursive); private: #ifdef _WIN32 CRITICAL_SECTION mutex; #else // pthread pthread_mutex_t mutex; #endif DISABLE_CLASS_COPY(Mutex); }; class RecursiveMutex : public Mutex { public: RecursiveMutex(); DISABLE_CLASS_COPY(RecursiveMutex); }; #endif // C++11 #endif