added necessary compiler memory barrier to xlock_release
authorFilippos Giannakos <philipgian@grnet.gr>
Thu, 30 Aug 2012 11:37:55 +0000 (14:37 +0300)
committerFilippos Giannakos <philipgian@grnet.gr>
Thu, 30 Aug 2012 11:37:55 +0000 (14:37 +0300)
also some makefile fixes

xseg/sys/user/Makefile
xseg/xtypes/xheap_test.c
xseg/xtypes/xlock.h

index cc86f73..3ab6667 100644 (file)
@@ -15,6 +15,10 @@ default: all
 
 all: libxseg.a libxseg.so
        make -C xq all
+       make -C xpool all
+       make -C xhash all
+       make -C xheap all
+       make -C xobj all
        make -C python all
 
 COMMA=,
index 1ec5a9e..08c27f7 100644 (file)
@@ -192,6 +192,10 @@ int main(int argc, const char *argv[])
 {
        unsigned long alloc, expected, i =0;
        int r;
+       if (argc < 5){
+               printf("Usage: %s al_unit size chunk_size nr_threads\n", argv[0]);
+               return -1;
+       }
        al_unit = atol(argv[1]); 
        size = atol(argv[2]); 
        chunk = atol(argv[3]);
index e607368..8b14302 100644 (file)
@@ -33,6 +33,7 @@ static inline unsigned long xlock_try_lock(struct xlock *lock, unsigned long who
 
 static inline void xlock_release(struct xlock *lock)
 {
+       BARRIER();
        lock->owner = Noone;
 }