projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't initialize static pointers to NULL
[collectd.git]
/
src
/
perl.c
diff --git
a/src/perl.c
b/src/perl.c
index
5ad99ee
..
d760b41
100644
(file)
--- a/
src/perl.c
+++ b/
src/perl.c
@@
-138,8
+138,8
@@
static int perl_flush(cdtime_t timeout, const char *identifier,
typedef struct c_ithread_s {
/* the thread's Perl interpreter */
PerlInterpreter *interp;
typedef struct c_ithread_s {
/* the thread's Perl interpreter */
PerlInterpreter *interp;
-
_B
ool running; /* thread is inside Perl interpreter */
-
_B
ool shutdown;
+
b
ool running; /* thread is inside Perl interpreter */
+
b
ool shutdown;
pthread_t pthread;
/* double linked list of threads */
pthread_t pthread;
/* double linked list of threads */
@@
-183,17
+183,17
@@
extern char **environ;
* private variables
*/
* private variables
*/
-static
_Bool register_legacy_flush = 1
;
+static
bool register_legacy_flush = true
;
/* if perl_threads != NULL perl_threads->head must
* point to the "base" thread */
/* if perl_threads != NULL perl_threads->head must
* point to the "base" thread */
-static c_ithread_list_t *perl_threads
= NULL
;
+static c_ithread_list_t *perl_threads;
/* the key used to store each pthread's ithread */
static pthread_key_t perl_thr_key;
static int perl_argc = 0;
/* the key used to store each pthread's ithread */
static pthread_key_t perl_thr_key;
static int perl_argc = 0;
-static char **perl_argv
= NULL
;
+static char **perl_argv;
static char base_name[DATA_MAX_NAME_LEN] = "";
static char base_name[DATA_MAX_NAME_LEN] = "";
@@
-981,7
+981,7
@@
static int pplugin_dispatch_notification(pTHX_ HV *notif) {
* Call perl sub with thread locking flags handled.
*/
static int call_pv_locked(pTHX_ const char *sub_name) {
* Call perl sub with thread locking flags handled.
*/
static int call_pv_locked(pTHX_ const char *sub_name) {
-
_B
ool old_running;
+
b
ool old_running;
int ret;
c_ithread_t *t = (c_ithread_t *)pthread_getspecific(perl_thr_key);
int ret;
c_ithread_t *t = (c_ithread_t *)pthread_getspecific(perl_thr_key);
@@
-989,7
+989,7
@@
static int call_pv_locked(pTHX_ const char *sub_name) {
return 0;
old_running = t->running;
return 0;
old_running = t->running;
- t->running =
1
;
+ t->running =
true
;
if (t->shutdown) {
t->running = old_running;
if (t->shutdown) {
t->running = old_running;
@@
-1189,7
+1189,7
@@
static void c_ithread_destroy(c_ithread_t *ithread) {
/* Mark as running to avoid deadlock:
c_ithread_destroy -> log_debug -> perl_log()
*/
/* Mark as running to avoid deadlock:
c_ithread_destroy -> log_debug -> perl_log()
*/
- ithread->running =
1
;
+ ithread->running =
true
;
log_debug("Shutting down Perl interpreter %p...", aTHX);
#if COLLECT_DEBUG
log_debug("Shutting down Perl interpreter %p...", aTHX);
#if COLLECT_DEBUG
@@
-1275,8
+1275,8
@@
static c_ithread_t *c_ithread_create(PerlInterpreter *base) {
}
t->pthread = pthread_self();
}
t->pthread = pthread_self();
- t->running =
0
;
- t->shutdown =
0
;
+ t->running =
false
;
+ t->shutdown =
false
;
perl_threads->tail = t;
pthread_setspecific(perl_thr_key, (const void *)t);
perl_threads->tail = t;
pthread_setspecific(perl_thr_key, (const void *)t);
@@
-2276,7
+2276,7
@@
static int perl_shutdown(void) {
* the thread as this will free the memory */
t = t->prev;
* the thread as this will free the memory */
t = t->prev;
- thr->shutdown =
1
;
+ thr->shutdown =
true
;
if (thr->running) {
/* Give some time to thread to exit from Perl interpreter */
WARNING("perl shutdown: Thread is running inside Perl. Waiting.");
if (thr->running) {
/* Give some time to thread to exit from Perl interpreter */
WARNING("perl shutdown: Thread is running inside Perl. Waiting.");