static tdm_private_thread_cb *
_tdm_thread_find_cb(struct list_head *list, void *object, tdm_thread_cb_type cb_type,
- void *cb_data, tdm_thread_cb func, void *user_data, pid_t caller_tid)
+ void *cb_data, tdm_thread_cb func, void *user_data)
{
tdm_private_thread_cb *cb = NULL;
cb->cb_type == cb_type &&
cb->cb_data == cb_data &&
cb->func == func &&
- cb->user_data == user_data &&
- cb->owner_tid == caller_tid)
+ cb->user_data == user_data)
return cb;
}
else
list = &cb_list[1];
- cb = _tdm_thread_find_cb(list, object, cb_type, cb_data, func, user_data, caller_tid);
+ cb = _tdm_thread_find_cb(list, object, cb_type, cb_data, func, user_data);
if (cb) {
pthread_mutex_unlock(&cb_list_lock);
TDM_ERR("can't be added twice with same data");
tdm_thread_cb_remove(void *object, tdm_thread_cb_type cb_type, void *cb_data, tdm_thread_cb func, void *user_data)
{
tdm_private_thread_cb *cb;
- pid_t caller_tid;
struct list_head *list;
TDM_RETURN_IF_FAIL(TDM_MUTEX_IS_LOCKED());
TDM_RETURN_IF_FAIL(cb_type > 0);
TDM_RETURN_IF_FAIL(func != NULL);
- caller_tid = syscall(SYS_gettid);
-
pthread_mutex_lock(&cb_list_lock);
- if (tdm_thread_in_display_thread(caller_tid))
- list = &cb_list[0];
- else
- list = &cb_list[1];
+ list = &cb_list[0];
+ cb = _tdm_thread_find_cb(list, object, cb_type, cb_data, func, user_data);
+ if (cb)
+ _tdm_thread_free_cb(cb);
- cb = _tdm_thread_find_cb(list, object, cb_type, cb_data, func, user_data, caller_tid);
- if (!cb) {
- pthread_mutex_unlock(&cb_list_lock);
- return;
- }
+ list = &cb_list[1];
+ cb = _tdm_thread_find_cb(list, object, cb_type, cb_data, func, user_data);
+ if (cb)
+ _tdm_thread_free_cb(cb);
- _tdm_thread_free_cb(cb);
pthread_mutex_unlock(&cb_list_lock);
}