mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 03:50:31 +00:00
don't create monitor threads in detached mode, when we need to be able to pthread_join() them later if the module is unloaded (solve crash-on-unload problem for these channel modules)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@9404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Asterisk -- An open source telephony toolkit.
|
||||
*
|
||||
* Copyright (C) 1999 - 2005, Digium, Inc.
|
||||
* Copyright (C) 1999 - 2006, Digium, Inc.
|
||||
*
|
||||
* Mark Spencer <markster@digium.com>
|
||||
*
|
||||
@@ -271,12 +271,8 @@ static void *do_devstate_changes(void *data)
|
||||
/*--- ast_device_state_engine_init: Initialize the device state engine in separate thread */
|
||||
int ast_device_state_engine_init(void)
|
||||
{
|
||||
pthread_attr_t attr;
|
||||
|
||||
ast_cond_init(&change_pending, NULL);
|
||||
pthread_attr_init(&attr);
|
||||
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
||||
if (ast_pthread_create(&change_thread, &attr, do_devstate_changes, NULL) < 0) {
|
||||
if (ast_pthread_create(&change_thread, NULL, do_devstate_changes, NULL) < 0) {
|
||||
ast_log(LOG_ERROR, "Unable to start device state change thread.\n");
|
||||
return -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user