From fbd93b493f7c694e1c750b110ded431a65cb9664 Mon Sep 17 00:00:00 2001 From: Carlo Bramini Date: Fri, 14 Mar 2008 20:05:34 +0000 Subject: Unportable pthread_t compare in xine.c With Pthreads for Win32/Win64 I cannot compare two pthread_t items because they are implemented as structures. This patch fixes the comparison by using pthread_equal() function. --HG-- extra : transplant_source : %9D%98%CE%83%5E%BD%A9u%11%C7%3BmP%28%EBH%D0%B6I%DF --- src/xine-engine/xine.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index c207680e6..efb845be5 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -133,7 +133,7 @@ static int acquire_allowed_to_block(xine_ticket_t *this) { unsigned new_size; for(entry = 0; entry < this->holder_thread_count; ++entry) { - if(this->holder_threads[entry].holder == own_id) { + if(pthread_equal(this->holder_threads[entry].holder, own_id)) { /* This thread may already hold this ticket */ this->holder_threads[entry].count++; return (this->holder_threads[entry].count == 1); @@ -204,7 +204,7 @@ static int release_allowed_to_block(xine_ticket_t *this) { unsigned entry; for(entry = 0; entry < this->holder_thread_count; ++entry) { - if(this->holder_threads[entry].holder == own_id) { + if(pthread_equal(this->holder_threads[entry].holder, own_id)) { this->holder_threads[entry].count--; return this->holder_threads[entry].count == 0; } -- cgit v1.2.3