| |
@@ -23,6 +23,7 @@
|
| |
#include "config.h"
|
| |
#endif
|
| |
|
| |
+ #include <inttypes.h>
|
| |
#include <sys/types.h>
|
| |
#include <search.h>
|
| |
#include <stdlib.h>
|
| |
@@ -40,6 +41,9 @@
|
| |
|
| |
#include <rpc/rpc.h>
|
| |
|
| |
+ /* NSPR private API for thread-local variables */
|
| |
+ #include <private/prpriv.h>
|
| |
+
|
| |
#include "backend.h"
|
| |
#include "disp-nis.h"
|
| |
#include "map.h"
|
| |
@@ -1264,7 +1268,7 @@
|
| |
|
| |
#if DEBUG_MAP_LOCK
|
| |
slapi_log_error(SLAPI_LOG_FATAL, "map_rdlock",
|
| |
- "thread_id = %p (call level = %d)\n", (void *) PR_MyThreadId(), wrap_get_call_level());
|
| |
+ "thread_id = %"PRIx32" (call level = %d)\n", PR_MyThreadId(), wrap_get_call_level());
|
| |
#endif
|
| |
if (lock_status == MAP_RWLOCK_UNINIT) {
|
| |
/* This is not initialized used the old way */
|
| |
@@ -1284,7 +1288,7 @@
|
| |
#if DEBUG_MAP_LOCK
|
| |
if (lock_count != 0) {
|
| |
slapi_log_error(SLAPI_LOG_FATAL, "schemacompat",
|
| |
- "map rdlock: (%p) ALERT !!! count was %d -> 1\n", (void *) PR_MyThreadId(), lock_count);
|
| |
+ "map rdlock: (%"PRIx32") ALERT !!! count was %d -> 1\n", PR_MyThreadId(), lock_count);
|
| |
}
|
| |
#endif
|
| |
|
| |
@@ -1292,12 +1296,12 @@
|
| |
rc = plugin_rdlock();
|
| |
if (rc) {
|
| |
slapi_log_error(SLAPI_LOG_FATAL, "schemacompat",
|
| |
- "map rdlock: (%p) MAP_RWLOCK_FREE -> MAP_RLOCK_HELD: fail to read lock plugin lock (%d)\n", (void *) PR_MyThreadId(), rc);
|
| |
+ "map rdlock: (%"PRIx32") MAP_RWLOCK_FREE -> MAP_RLOCK_HELD: fail to read lock plugin lock (%d)\n", PR_MyThreadId(), rc);
|
| |
return rc;
|
| |
}
|
| |
#if DEBUG_MAP_LOCK
|
| |
slapi_log_error(SLAPI_LOG_FATAL, "schemacompat",
|
| |
- "map rdlock: (%p) MAP_RWLOCK_FREE -> MAP_RLOCK_HELD : count=%d\n", (void *) PR_MyThreadId(), 1);
|
| |
+ "map rdlock: (%"PRIx32") MAP_RWLOCK_FREE -> MAP_RLOCK_HELD : count=%d\n", PR_MyThreadId(), 1);
|
| |
#endif
|
| |
rc = wrap_rwlock_rdlock(map_data.lock);
|
| |
if (rc) {
|
| |
@@ -1311,8 +1315,8 @@
|
| |
|
| |
#if DEBUG_MAP_LOCK
|
| |
slapi_log_error(SLAPI_LOG_FATAL, "schemacompat",
|
| |
- "map rdlock: (%p) was already hold %s : count=%d > %d!!!\n",
|
| |
- (void *) PR_MyThreadId(),
|
| |
+ "map rdlock: (%x"PRIx32") was already hold %s : count=%d > %d!!!\n",
|
| |
+ PR_MyThreadId(),
|
| |
(lock_status == MAP_WLOCK_HELD) ? "MAP_WLOCK_HELD" : "MAP_RLOCK_HELD",
|
| |
lock_count, lock_count + 1);
|
| |
#endif
|
| |
@@ -1360,25 +1364,25 @@
|
| |
#if DEBUG_MAP_LOCK
|
| |
if (lock_count != 0) {
|
| |
slapi_log_error(SLAPI_LOG_FATAL, "schema-compat",
|
| |
- "map wrlock: (%p) ALERT !!! count was %d --> 1\n", (void *) PR_MyThreadId(), lock_count);
|
| |
+ "map wrlock: (%"PRIx32") ALERT !!! count was %d --> 1\n", PR_MyThreadId(), lock_count);
|
| |
}
|
| |
#endif
|
| |
/* Acquire the slapi plugin in write */
|
| |
rc = plugin_wrlock();
|
| |
if (rc) {
|
| |
slapi_log_error(SLAPI_LOG_FATAL, "schemacompat",
|
| |
- "map wrlock: (%p) MAP_RWLOCK_FREE -> MAP_RLOCK_HELD: fail to read lock plugin lock (%d)\n", (void *) PR_MyThreadId(), rc);
|
| |
+ "map wrlock: (%"PRIx32") MAP_RWLOCK_FREE -> MAP_RLOCK_HELD: fail to read lock plugin lock (%d)\n", PR_MyThreadId(), rc);
|
| |
return rc;
|
| |
}
|
| |
#if DEBUG_MAP_LOCK
|
| |
slapi_log_error(SLAPI_LOG_FATAL, "schema-compat",
|
| |
- "map wrlock: (%p) MAP_RWLOCK_FREE --> MAP_WLOCK_HELD : count=%d\n", (void *) PR_MyThreadId(), 1);
|
| |
+ "map wrlock: (%"PRIx32") MAP_RWLOCK_FREE --> MAP_WLOCK_HELD : count=%d\n", PR_MyThreadId(), 1);
|
| |
#endif
|
| |
|
| |
rc = wrap_rwlock_wrlock(map_data.lock);
|
| |
if (rc) {
|
| |
slapi_log_error(SLAPI_LOG_FATAL, "schema-compat",
|
| |
- "map wrlock: (%p) MAP_RWLOCK_FREE --> MAP_WLOCK_HELD : fail to write lock map lock (%d)\n", (void *) PR_MyThreadId(), rc);
|
| |
+ "map wrlock: (%"PRIx32") MAP_RWLOCK_FREE --> MAP_WLOCK_HELD : fail to write lock map lock (%d)\n", PR_MyThreadId(), rc);
|
| |
plugin_unlock();
|
| |
goto common;
|
| |
}
|
| |
@@ -1386,8 +1390,8 @@
|
| |
set_plugin_monitor_count(lock_count + 1);
|
| |
#if DEBUG_MAP_LOCK
|
| |
slapi_log_error(SLAPI_LOG_FATAL, "schema-compat",
|
| |
- "map wrlock: (%p) %s --> MAP_WLOCK_HELD : count=%d\n",
|
| |
- (void *) PR_MyThreadId(),
|
| |
+ "map wrlock: (%"PRIx32") %s --> MAP_WLOCK_HELD : count=%d\n",
|
| |
+ PR_MyThreadId(),
|
| |
(lock_status == MAP_WLOCK_HELD) ? "MAP_WLOCK_HELD" : "MAP_RLOCK_HELD",
|
| |
lock_count + 1);
|
| |
#endif
|
| |