From 0970b97bed90ae7d5452e412b9cfd6af8a3b0463 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 22 Apr 2008 15:04:01 +0000 Subject: [PATCH] Added support_kit_config.h configuration header. ATM it only contains a setting to force BLockers to be semaphore style. This may help with debugging deadlocks. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25096 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/config_headers/support_kit_config.h | 8 ++++++++ src/kits/support/Locker.cpp | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 build/config_headers/support_kit_config.h diff --git a/build/config_headers/support_kit_config.h b/build/config_headers/support_kit_config.h new file mode 100644 index 0000000000..a907b302e3 --- /dev/null +++ b/build/config_headers/support_kit_config.h @@ -0,0 +1,8 @@ +#ifndef SUPPORT_KIT_CONFIG_H +#define SUPPORT_KIT_CONFIG_H + + +#define BLOCKER_ALWAYS_SEMAPHORE_STYLE 0 + + +#endif // SUPPORT_KIT_CONFIG_H diff --git a/src/kits/support/Locker.cpp b/src/kits/support/Locker.cpp index af7827a0ab..48c0b99dbb 100644 --- a/src/kits/support/Locker.cpp +++ b/src/kits/support/Locker.cpp @@ -12,6 +12,7 @@ #include #include +#include "support_kit_config.h" // // Data Member Documentation: @@ -188,7 +189,7 @@ BLocker::InitLocker(const char *name, bool benaphore) if (name == NULL) name = "some BLocker"; - if (benaphore) { + if (benaphore && !BLOCKER_ALWAYS_SEMAPHORE_STYLE) { // Because this is a benaphore, initialize the benaphore count and // create the semaphore. Because this is a benaphore, the semaphore // count starts at 0 (ie acquired).