Ignore:
Timestamp:
2011-01-07T14:40:56Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8324b65
Parents:
92f924c8
Message:

Add synchronization via fibril_semaphore

WARNING: fibril_semaphore BREAKS the deadlock detection system
used by fibril synch primitives

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci/utils/hc_synchronizer.c

    r92f924c8 r7bd34e5  
    11#include "hc_synchronizer.h"
    22
     3void sync_init(sync_value_t *value)
     4{
     5        assert(value);
     6        fibril_semaphore_initialize(&value->done, 0);
     7}
     8/*----------------------------------------------------------------------------*/
    39void sync_wait_for(sync_value_t *value)
    410{
    511        assert( value );
    6         value->waiting_fibril = fibril_get_id();
    7         uhci_print_verbose("turning off fibril %p.\n", value->waiting_fibril);
    8         fibril_switch(FIBRIL_TO_MANAGER);
     12        fibril_semaphore_down(&value->done);
    913}
    1014/*----------------------------------------------------------------------------*/
     
    1620        value->size = size;
    1721        value->result = result;
    18         fibril_add_ready(value->waiting_fibril);
     22        fibril_semaphore_up(&value->done);
    1923}
    2024/*----------------------------------------------------------------------------*/
     
    2529        assert(value);
    2630        value->result = result;
    27         uhci_print_verbose("resuming fibril %p.\n", value->waiting_fibril);
    28         fibril_add_ready(value->waiting_fibril);
     31        fibril_semaphore_up(&value->done);
    2932}
Note: See TracChangeset for help on using the changeset viewer.