Re: [xine-cvs] HG: xine-lib-1.2: Optimize and fix tickets.

Petri Hintukainen <[email protected]> Tue, 30 May 2017 18:20:10 +0300
Newsgroups gmane.comp.video.xine.devel
Message-ID <[email protected]>
Hello,

pe, 2017-05-12 kello 16:58 +0000, Torsten Jager kirjoitti:
> # HG changeset patch
> # User Torsten Jager <[email protected]>
> # Date 1494608295 -7200
> # Node ID b5bda796645ad02695bf639e7dc5c80a74597f17
> # Branch  default
> # Parent  f2ecec7bd4f0996ce8f0b0dd715d77362fb2359d
> Optimize and fix tickets.
[...]
> -static int ticket_acquire_internal(xine_ticket_t *this, int
> irrevocable, int nonblocking) {
> -  int must_wait = 0;
> -
> -  pthread_mutex_lock(&this->lock);
> -  int allowed_to_block = acquire_allowed_to_block(this);
> -
> -  if (this->ticket_revoked && !this->irrevocable_tickets)
> -    must_wait = !nonblocking;
> -  else if (this->atomic_revoke && !pthread_equal(this-
> >atomic_revoker_thread, pthread_self()))
> -    must_wait = 1;
> -
> -  if (must_wait && allowed_to_block) {
> -    if (nonblocking) {
> -      pthread_mutex_unlock(&this->lock);
> +
> +  if (i == this->holder_thread_count) {
> +    /* not found */
> +    wait = (this->ticket_revoked && !this->irrevocable_tickets) ?
> !nonblocking
> +         : (this->atomic_revoke ? !pthread_equal (this-
> >atomic_revoker_thread, self) : 0);
> +    if (nonblocking && wait) {
> +      /* not available immediately, bail out */
> +      pthread_mutex_unlock (&this->lock);
>        return 0;
>      }
> -
> -    pthread_cond_wait(&this->issued, &this->lock);
> +    /* add */
> +    if (((i & 31) == 31) && (this->holder_threads[i].count = -1000))

Looks like there's one '=' missing ?

I didn't look the code deep enough to be sure, but as an assigment it
has no effect on comparsion result.


- Petri
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
xine-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xine-devel