Changeset 9e45e46


Ignore:
Timestamp:
Feb 9, 2017, 5:31:23 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:
a073d46
Parents:
8d4f7fe
Message:

Removed unnecessary code/comments

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/examples/multicore.c

    r8d4f7fe r9e45e46  
    99
    1010void main( MyThread* this ) {
    11         for(int i = 0; i < 10000000; i++) {
     11        for(int i = 0; i < 1000000; i++) {
    1212                yield();
    1313        }
     
    1515
    1616int main(int argc, char* argv[]) {
    17         sout | "User main begin" | endl;
     17        // sout | "User main begin" | endl;
    1818        {
    1919                processor p;
     
    2525                }
    2626        }
    27         sout | "User main end" | endl;
     27        // sout | "User main end" | endl;
    2828}
  • src/libcfa/concurrency/kernel

    r8d4f7fe r9e45e46  
    6868void unlock( simple_lock * );
    6969
    70 struct pthread_spinlock_guard {
    71         pthread_spinlock_t * lock;
    72 };
    73 
    74 static inline void ?{}( pthread_spinlock_guard * this, pthread_spinlock_t * lock ) {
    75         this->lock = lock;
    76         pthread_spin_lock( this->lock );
    77 }
    78 
    79 static inline void ^?{}( pthread_spinlock_guard * this ) {
    80         pthread_spin_unlock( this->lock );
    81 }
    82 
    83 // //Simple spinlock implementation from
    84 // //http://stackoverflow.com/questions/1383363/is-my-spin-lock-implementation-correct-and-optimal
    85 // //Not optimal but correct
    86 // #define VOL
    87 
    88 // struct simple_spinlock {
    89 //      VOL int lock;
    90 // };
    91 
    92 // extern VOL int __sync_lock_test_and_set( VOL int *, VOL int);
    93 // extern void __sync_synchronize();
    94 
    95 // static inline void lock( simple_spinlock * this ) {
    96 //     while (__sync_lock_test_and_set(&this->lock, 1)) {
    97 //         // Do nothing. This GCC builtin instruction
    98 //         // ensures memory barrier.
    99 //     }
    100 // }
    101 
    102 // static inline void unlock( simple_spinlock * this ) {
    103 //     __sync_synchronize(); // Memory barrier.
    104 //     this->lock = 0;
    105 // }
    106 
    10770#endif //KERNEL_H
    10871
Note: See TracChangeset for help on using the changeset viewer.