Skip to content
Snippets Groups Projects
Commit 2842a884 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#3749] use gthread instread of pthread

parent 7369d2d2
No related branches found
No related tags found
No related merge requests found
......@@ -188,6 +188,7 @@ void *threaded_clock_incrementer(void *pc) {
void create_new_call (callable_type_t type, call_state_t state, gchar* callID , gchar* accountID, gchar* peer_name, gchar* peer_number, callable_obj_t ** new_call)
{
GError *err1 = NULL ;
callable_obj_t *obj;
gchar *call_id;
......@@ -226,7 +227,13 @@ void create_new_call (callable_type_t type, call_state_t state, gchar* callID ,
obj->clockStarted = 1;
pthread_create(&(obj->tid), NULL, threaded_clock_incrementer, obj);
// pthread_create(&(obj->tid), NULL, threaded_clock_incrementer, obj);
if( (obj->tid = g_thread_create((GThreadFunc)threaded_clock_incrementer, (void *)obj, TRUE, &err1)) == NULL)
{
// printf("Thread create failed: %s!!\n", err1->message );
g_error_free ( err1 ) ;
}
*new_call = obj;
}
......@@ -323,12 +330,13 @@ void free_callable_obj_t (callable_obj_t *c)
{
DEBUG("CallableObj: Free callable object");
if(!c)
ERROR("CallableObj: Callable object is NULL");
c->clockStarted = 0;
g_thread_join(c->tid);
g_free (c->_callID);
g_free (c->_accountID);
g_free (c->_peer_name);
......@@ -338,7 +346,7 @@ void free_callable_obj_t (callable_obj_t *c)
DEBUG("If you don't see it that is because there is a problem");
// calltree_update_clock();
calltree_update_clock();
}
void attach_thumbnail (callable_obj_t *call, GdkPixbuf *pixbuf) {
......
......@@ -120,6 +120,7 @@ typedef struct {
gboolean _zrtp_confirmed; // Override real state. Used for hold/unhold
// since rtp session is killed each time and
// libzrtpcpp does not remember state (yet?)
/**
* The information about the person we are talking
*/
......@@ -153,7 +154,8 @@ typedef struct {
gchar *_audio_codec;
// thread id to increment clock
pthread_t tid;
// pthread_t tid;
GThread *tid;
int clockStarted;
......
......@@ -115,13 +115,13 @@ calllist_clean_history( void )
{
unsigned int i;
guint size = calllist_get_size( history );
DEBUG("history list size = %i", calllist_get_size( history ));
DEBUG("CallList: history list size = %i", calllist_get_size( history ));
for( i = 0 ; i < size ; i++ )
{
DEBUG("Delete calls");
DEBUG("CallList: Delete calls");
callable_obj_t* c = calllist_get_nth( history , i );
// Delete the call from the call tree
DEBUG("Delete calls");
DEBUG("CallList: Delete calls");
calltree_remove_call(history, c, NULL);
}
calllist_reset( history );
......@@ -133,7 +133,7 @@ calllist_remove_from_history( callable_obj_t* c )
{
calllist_remove( history, c->_callID );
calltree_remove_call(history, c, NULL);
DEBUG("Size of history = %i" , calllist_get_size( history ));
DEBUG("CallList: Size of history = %i" , calllist_get_size( history ));
}
void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment