From: SourceForge.net <no...@so...> - 2004-07-23 13:36:22
|
Bugs item #952821, was opened at 2004-05-12 21:57 Message generated for change (Comment added) made by f1rmb You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109655&aid=952821&group_id=9655 Category: gui Group: None >Status: Closed Resolution: None Priority: 5 Submitted By: Matthias Drochner (drochner) Assigned to: Daniel Caujolle-Bert (f1rmb) Summary: improper use of pthread_mutex_* Initial Comment: Pthread mutexes mean that the calling thread owns that mutex. xine-ui-0.99.1 does the following: -xe_mutex is locked in gui_set_current_position() -gui_set_current_position_thread() is started -it tries to unlock xe_mutex That isn't going to work. Appearently Linux's libpthread tolerates it, it might also be that error codes are returned which are not checked, but it is broken. NetBSD's libpthread complains, so I got aware of the problem. This patch helps: --- src/xitk/actions.c.orig 2004-05-12 17:57:24.000000000 +0200 +++ src/xitk/actions.c 2004-05-12 18:00:06.000000000 +0200 @@ -1039,6 +1039,11 @@ pthread_detach(pthread_self()); + if (pthread_mutex_trylock(&gGui->xe_mutex)) { + pthread_exit(NULL); + return NULL; + } + if(gGui->logo_mode && (mediamark_get_current_mrl())) { if(!xine_open(gGui->stream, (mediamark_get_current_mrl()))) { gui_handle_xine_error(gGui->stream, (char *)(mediamark_get_current_mrl())); @@ -1170,8 +1175,6 @@ if(gGui->new_pos == -1) { - pthread_mutex_lock(&gGui->xe_mutex); - pthread_mutex_lock(&new_pos_mutex); gGui->new_pos = pos; pthread_mutex_unlock(&new_pos_mutex); ---------------------------------------------------------------------- >Comment By: Daniel Caujolle-Bert (f1rmb) Date: 2004-07-23 15:36 Message: Logged In: YES user_id=78547 Thanks for the patch. A modified version has been commited. Cheers. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109655&aid=952821&group_id=9655 |