Ignore:
Timestamp:
May 29, 2018, 9:27:23 AM (4 years ago)
Author:
alain
Message:

Restructure the mini_libc.

Location:
trunk/libs/libpthread
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/libs/libpthread/pthread.c

    r444 r445  
    11/*
    2  * pthread.c - User side pthread related functions implementation.
     2 * pthread.c - User leve <pthread> library implementation.
    33 *
    44 * Author     Alain Greiner (2016,2017,2018)
     
    2323
    2424#include <hal_user.h>
     25#include <hal_types.h>
    2526#include <stdio.h>
    2627#include <stdlib.h>
    2728#include <pthread.h>
    28 #include <assert.h>
    29 #include <almos-mkh.h>
     29#include <almosmkh.h>
    3030#include <syscalls_numbers.h>
    3131
    3232#define PTHREAD_MUTEX_DEBUG     0
    3333#define PTHREAD_BARRIER_DEBUG   0
    34 
    35 #define  reg_t     int
    3634
    3735////////////////////////////////////////////////////////////////////////////////////////////
     
    205203
    206204    // check attributes
    207     assert( x_size <= QDT_XMAX );
    208     assert( y_size <= QDT_YMAX );
    209     assert( x_size * y_size * nthreads == count );
     205    if( (x_size * y_size * nthreads) != count )
     206    {
     207        printf("\[ERROR] in %s : count != x_size * y_size * nthreads/n", __FUNCTION__);
     208        exit( EXIT_FAILURE );
     209    }
    210210   
    211211    // compute SQT levels
     
    319319    else                                               // not the last thread
    320320    {
    321         // poll sense
    322321        while( 1 )
    323322        {
     323            // poll sense
    324324            if( node->sense == expected ) break;
     325
     326            // deschedule
     327            pthread_yield();
    325328        }
    326329
Note: See TracChangeset for help on using the changeset viewer.