Navigation


Changeset 691:78b665400097 in freeDiameter for libfdcore/p_psm.c


Ignore:
Timestamp:
Jan 20, 2011, 7:44:27 PM (13 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Cleanup all pthread_cleanup_push / pop pairs so that pop is always called after push, or ASSERT(0) is some grave errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/p_psm.c

    r688 r691  
    5555static int fd_psm_waitstart()
    5656{
     57        int ret = 0;
    5758        TRACE_ENTRY("");
    5859        CHECK_POSIX( pthread_mutex_lock(&started_mtx) );
    5960awake: 
    60         if (! started) {
     61        if (!ret && !started) {
    6162                pthread_cleanup_push( fd_cleanup_mutex, &started_mtx );
    62                 CHECK_POSIX( pthread_cond_wait(&started_cnd, &started_mtx) );
     63                CHECK_POSIX_DO( ret = pthread_cond_wait(&started_cnd, &started_mtx), );
    6364                pthread_cleanup_pop( 0 );
    6465                goto awake;
    6566        }
    6667        CHECK_POSIX( pthread_mutex_unlock(&started_mtx) );
    67         return 0;
     68        return ret;
    6869}
    6970
Note: See TracChangeset for help on using the changeset viewer.