Changeset 01ff41c in mainline for libc/generic/psthread.c


Ignore:
Timestamp:
2006-05-27T22:28:25Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7f5b37a
Parents:
7f9cd77
Message:

Added functions to async framework for reasonable sending asynchronous
messages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libc/generic/psthread.c

    r7f9cd77 r01ff41c  
    118118/** Schedule next userspace pseudo thread.
    119119 *
     120 * If calling with PS_TO_MANAGER parameter, the async_futex should be
     121 * held.
     122 *
    120123 * @param tomanager If true, we are switching to next ready manager thread
    121124 *                  (if none is found, thread is exited)
     
    137140        }
    138141        /* If we are going to manager and none exists, create it */
    139         if (ctype == PS_TO_MANAGER && list_empty(&manager_list))
     142        while (ctype == PS_TO_MANAGER && list_empty(&manager_list)) {
     143                futex_up(&psthread_futex);
    140144                async_create_manager();
     145                futex_down(&psthread_futex);
     146        }
    141147
    142148        pt = __tcb_get()->pst_data;
     
    260266        futex_up(&psthread_futex);
    261267}
     268
     269/** Return thread id of current running thread */
     270pstid_t psthread_get_id(void)
     271{
     272        return (pstid_t)__tcb_get()->pst_data;
     273}
Note: See TracChangeset for help on using the changeset viewer.