Changeset 84c52a8 for src


Ignore:
Timestamp:
Mar 15, 2017, 4:14:31 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
348006f
Parents:
c3acb841
Message:

Renamed monitor_t to monitor_desc

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/monitor

    rc3acb841 r84c52a8  
    2222#include "stdlib"
    2323
    24 struct __monitor_t {
     24struct monitor_desc {
    2525        spinlock lock;
    2626        thread * owner;
     
    2929};
    3030
    31 static inline void ?{}(__monitor_t * this) {
     31static inline void ?{}(monitor_desc * this) {
    3232        this->owner = 0;
    3333        this->recursion = 0;
     
    3535
    3636//Basic entering routine
    37 void enter(__monitor_t *);
    38 void leave(__monitor_t *);
     37void enter(monitor_desc *);
     38void leave(monitor_desc *);
    3939
    4040//Array entering routine
    41 void enter(__monitor_t **, int count);
    42 void leave(__monitor_t **, int count);
     41void enter(monitor_desc **, int count);
     42void leave(monitor_desc **, int count);
    4343
    4444struct monitor_guard_t {
    45         __monitor_t ** m;
     45        monitor_desc ** m;
    4646        int count;
    4747};
    4848
    49 static inline int ?<?(__monitor_t* lhs, __monitor_t* rhs) {
     49static inline int ?<?(monitor_desc* lhs, monitor_desc* rhs) {
    5050        return ((intptr_t)lhs) < ((intptr_t)rhs);
    5151}
    5252
    53 static inline void ?{}( monitor_guard_t * this, __monitor_t ** m ) {
     53static inline void ?{}( monitor_guard_t * this, monitor_desc ** m ) {
    5454        this->m = m;
    5555        this->count = 1;
     
    5757}
    5858
    59 static inline void ?{}( monitor_guard_t * this, __monitor_t ** m, int count ) {
     59static inline void ?{}( monitor_guard_t * this, monitor_desc ** m, int count ) {
    6060        this->m = m;
    6161        this->count = count;
  • src/libcfa/concurrency/monitor.c

    rc3acb841 r84c52a8  
    66// file "LICENCE" distributed with Cforall.
    77//
    8 // __monitor_t.c --
     8// monitor_desc.c --
    99//
    1010// Author           : Thierry Delisle
     
    1919#include "kernel_private.h"
    2020
    21 void enter(__monitor_t * this) {
     21void enter(monitor_desc * this) {
    2222        lock( &this->lock );
    2323        thread * thrd = this_thread();
     
    4545}
    4646
    47 void leave(__monitor_t * this) {
     47void leave(monitor_desc * this) {
    4848        lock( &this->lock );
    4949
     
    7272}
    7373
    74 void enter(__monitor_t ** monitors, int count) {
     74void enter(monitor_desc ** monitors, int count) {
    7575        for(int i = 0; i < count; i++) {
    7676                // printf("%d\n", i);
     
    7979}
    8080
    81 void leave(__monitor_t ** monitors, int count) {
     81void leave(monitor_desc ** monitors, int count) {
    8282        for(int i = count - 1; i >= 0; i--) {
    8383                // printf("%d\n", i);
  • src/tests/monitor.c

    rc3acb841 r84c52a8  
    66struct global_t {
    77        int value;
    8         __monitor_t m;
     8        monitor_desc m;
    99};
    1010
     
    1616
    1717void increment( /*mutex*/ global_t * this ) {
    18         __monitor_t * mon = &this->m;
     18        monitor_desc * mon = &this->m;
    1919        monitor_guard_t g1 = { &mon };
    2020        {
  • src/tests/multi-monitor.c

    rc3acb841 r84c52a8  
    66static int global12, global23, global13;
    77
    8 static __monitor_t m1, m2, m3;
     8static monitor_desc m1, m2, m3;
    99
    10 void increment( /*mutex*/ __monitor_t * p1, /*mutex*/ __monitor_t * p2, int * value ) {
    11         __monitor_t * mons[] = { p1, p2 };
     10void increment( /*mutex*/ monitor_desc * p1, /*mutex*/ monitor_desc * p2, int * value ) {
     11        monitor_desc * mons[] = { p1, p2 };
    1212        monitor_guard_t g = { mons, 2 };
    1313        *value += 1;
Note: See TracChangeset for help on using the changeset viewer.