Esempio n. 1
0
void unlock( void )
{
    Huint mid;

    // Lock all of the mutexes
    for( mid = 0; mid < MUTEX_MAX; mid++ )
    {
        // Attempt to acquire the mutex for thread id 0
        _mutex_release( mid, mid );

        // Print out the status information that was returned
        //printf( "UNLOCK: (MID=%d)\n", mid );
    }
}
Esempio n. 2
0
/** \internal
 *  \brief  Release a mutex lock.
 *
 *  \author Wesley Peck <*****@*****.**>
 *
 *  This function is used to release a lock for the given mutex.
 *
 *  \param  mutex   The mutex to release the lock for.
 */
Hint _syscall_mutex_unlock( hthread_mutex_t *mutex )
{
    Huint cur;

    // Print out a trace message about this system call
    TRACE_PRINTF( TRACE_FINE, TRACE_SYSCALL, "SYSCALL: (OP=UNLOCK) (MTX=%d)\n", (Huint)mutex->num );

    cur = _current_thread();
    _mutex_release( cur, mutex->num );

    // Print out a trace message about this system call
    TRACE_PRINTF( TRACE_FINE, TRACE_SYSCALL, "SYSCALL DONE: (OP=UNLOCK) (MTX=%d)\n", (Huint)mutex->num );

    return SUCCESS;
}
Esempio n. 3
0
void unlock( void )
{
    Huint mid;

    // Print out a banner for the first attempt
    printf( "----------------------------------------------------------------------\n" );
    printf( "- Unlocking Mutexes                                                  -\n" );
    printf( "----------------------------------------------------------------------\n" );

    // Lock all of the mutexes
    for( mid = 0; mid < MUTEX_MAX; mid++ )
    {
        // Attempt to acquire the mutex for thread id 0
        _mutex_release( 0, mid );

        // Print out the status information that was returned
        printf( "UNLOCK: (MID=%d)\n", mid );
    }
}