Changeset: c557e45dd5c0 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c557e45dd5c0
Modified Files:
gdk/gdk.mx
gdk/gdk_bbp.mx
gdk/gdk_system.mx
gdk/gdk_utils.mx
monetdb4/modules/contrib/qt.mx
monetdb4/modules/contrib/salgebra.mx
monetdb4/modules/mapi/mapi.mx
monetdb4/modules/plain/alarm.mx
monetdb4/modules/plain/enum.mx
monetdb4/modules/plain/tcpip.mx
monetdb4/monet/monet.mx
monetdb4/monet/monet_tbl.mx
monetdb5/mal/mal.mx
monetdb5/mal/mal_box.mx
monetdb5/mal/mal_client.mx
monetdb5/mal/mal_interpreter.mx
monetdb5/mal/mal_recycle.mx
monetdb5/modules/kernel/alarm.mx
monetdb5/modules/mal/tablet_mk.mx
monetdb5/modules/mal/tablet_si.mx
monetdb5/modules/mal/tablet_sql.mx
monetdb5/scheduler/run_octopus.mx
pathfinder/runtime/pathfinder.mx
pathfinder/runtime/pf_support.mx
pathfinder/runtime/xrpc_server.mx
sql/storage/bpm/bpm_distribution.c
sql/storage/bpm/bpm_storage.c
sql/storage/store.c
Branch: default
Log Message:
Get rid of backward compatible interface.
MT_*_{lock,sema,cond} have been called a backward compatible interface
for long enough.
diffs (truncated from 2214 to 300 lines):
diff --git a/gdk/gdk.mx b/gdk/gdk.mx
--- a/gdk/gdk.mx
+++ b/gdk/gdk.mx
@@ -2745,12 +2745,12 @@
@{
@h
*/
-#define gdk_set_lock(X,Y) if (GDKprotected) MT_set_lock(X,Y)
-#define gdk_unset_lock(X,Y) if (GDKprotected) MT_unset_lock(X,Y)
-#define gdk_up_sema(X,Y) if (GDKprotected) MT_up_sema(X,Y)
-#define gdk_down_sema(X,Y) if (GDKprotected) MT_down_sema(X,Y)
-#define gdk_signal_cond(X,Y) if (GDKprotected) MT_signal_cond(X,Y)
-#define gdk_wait_cond(X,Y,Z) if (GDKprotected) MT_wait_cond(X,Y,Z)
+#define gdk_set_lock(X,Y) if (GDKprotected) MT_lock_set(&X,Y)
+#define gdk_unset_lock(X,Y) if (GDKprotected) MT_lock_unset(&X,Y)
+#define gdk_up_sema(X,Y) if (GDKprotected) MT_sema_up(&X,Y)
+#define gdk_down_sema(X,Y) if (GDKprotected) MT_sema_down(&X,Y)
+#define gdk_signal_cond(X,Y) if (GDKprotected) MT_cond_signal(&X,Y)
+#define gdk_wait_cond(X,Y,Z) if (GDKprotected) MT_cond_wait(&X,&Y,Z)
/*
@}
@-
diff --git a/gdk/gdk_bbp.mx b/gdk/gdk_bbp.mx
--- a/gdk/gdk_bbp.mx
+++ b/gdk/gdk_bbp.mx
@@ -3223,7 +3223,7 @@
/* initialize the cache */
for (j = 0; j < BATCACHE_MAXBUCKETS; j++) {
- MT_init_lock(batcache[j].lock, "GDKbinsLock");
+ MT_lock_init(&batcache[j].lock, "GDKbinsLock");
for (i = 0; i < BATCACHE_SIZE; i++) {
batcache[j].elt[i].bid = 0;
@@ -3286,7 +3286,7 @@
{
/* get a free slot */
batcache_int j, i;
- MT_set_lock(bc->lock, "batcache_put");
+ MT_lock_set(&bc->lock, "batcache_put");
i = bc->free;
if (i >= 0) {
@@ -3314,7 +3314,7 @@
*BBP_logical(bid) = '.';
*BBP_logical(-bid) = '.';
- MT_unset_lock(bc->lock, "batcache_put");
+ MT_lock_unset(&bc->lock, "batcache_put");
return i;
}
@@ -3326,7 +3326,7 @@
batcache_int i;
bat bid = 0;
- MT_set_lock(bc->lock, "batcache_get");
+ MT_lock_set(&bc->lock, "batcache_get");
i = bc->batbin[bin];
if (i >= 0) {
@@ -3367,7 +3367,7 @@
/* clearing bits can be done without the lock */
BBP_status_off(bid, BBPUNLOADING, "BBPrecycle");
}
- MT_unset_lock(bc->lock, "batcache_get");
+ MT_lock_unset(&bc->lock, "batcache_get");
return bid;
}
diff --git a/gdk/gdk_system.mx b/gdk/gdk_system.mx
--- a/gdk/gdk_system.mx
+++ b/gdk/gdk_system.mx
@@ -197,14 +197,6 @@
#define MT_lock_try(l) pthread_mutex_trylock((pthread_mutex_t *) l)
#define MT_lock_dump(l,fp,n) MT_log(/*nothing*/, &l, "MT_dump_lock", n, fp)
-/* backward compatability API */
-#define MT_init_lock(l,n) MT_lock_init(&l,n)
-#define MT_destroy_lock(l) MT_lock_destroy(&l)
-#define MT_set_lock(l,n) MT_lock_set(&l,n)
-#define MT_unset_lock(l,n) MT_lock_unset(&l,n)
-#define MT_try_lock(l) MT_lock_try(&l)
-#define MT_dump_lock(l,fp,n) MT_lock_dump(&l,fp,n)
-
gdk_export MT_Lock MT_system_lock;
@- MT Semaphore API
@@ -242,13 +234,6 @@
#define MT_sema_down(s,n) MT_log_trace(pthread_sema_down(s), s,
"MT_down_sema", n, stderr, s)
#define MT_sema_dump(s,fp,n) MT_log(/*nothing*/, s, "MT_dump_sema", n, fp)
-/* backward compatability API */
-#define MT_init_sema(s,nr,n) MT_sema_init(&s,nr,n)
-#define MT_destroy_sema(s) MT_sema_destroy(&s)
-#define MT_up_sema(s,n) MT_sema_up(&s,n)
-#define MT_down_sema(s,n) MT_sema_down(&s,n)
-#define MT_dump_sema(s,fp,n) MT_sema_dump(&s,fp,n)
-
@- MT Conditional Variable API
@h
#if !defined(HAVE_PTHREAD_H) && defined(_MSC_VER)
@@ -270,12 +255,6 @@
#define MT_cond_signal(c,n) MT_log(pthread_cond_signal((pthread_cond_t*) c),
c, "MT_signal_cond", n, stderr)
#define MT_cond_wait(c,l,n) MT_log_trace(pthread_cond_wait((pthread_cond_t*)
c, (pthread_mutex_t *) l), c, "MT_wait_cond", n, stderr, c)
-/* backward compatability API */
-#define MT_init_cond(c,n) MT_cond_init(&c,n)
-#define MT_destroy_cond(c) MT_cond_destroy(&c)
-#define MT_signal_cond(c,n) MT_cond_signal(&c,n)
-#define MT_wait_cond(c,l,n) MT_cond_wait(&c,&l,n)
-
gdk_export int MT_check_nr_cores(void);
#endif /*_GDK_SYSTEM_H_*/
diff --git a/gdk/gdk_utils.mx b/gdk/gdk_utils.mx
--- a/gdk/gdk_utils.mx
+++ b/gdk/gdk_utils.mx
@@ -446,7 +446,7 @@
static MT_Lock mbyteslock;
#define malloc_lock() gdk_set_lock(mbyteslock, "malloc")
#define malloc_unlock() gdk_unset_lock(mbyteslock, "malloc");
-#define malloc_lock_init() MT_init_lock(mbyteslock, "mbyteslock")
+#define malloc_lock_init() MT_lock_init(&mbyteslock, "mbyteslock")
#else
#define malloc_lock()
#define malloc_unlock()
@@ -1470,19 +1470,19 @@
TMDEBUG printf("# GDKlocks created\n");
for (i = 0; i <= BBP_BATMASK; i++) {
- MT_init_lock(GDKbatLock[i].swap, "GDKswapLock");
- MT_init_lock(GDKbatLock[i].hash, "GDKhashLock");
+ MT_lock_init(&GDKbatLock[i].swap, "GDKswapLock");
+ MT_lock_init(&GDKbatLock[i].hash, "GDKhashLock");
}
for (i = 0; i <= BBP_THREADMASK; i++) {
- MT_init_lock(GDKbbpLock[i].alloc, "GDKcacheLock");
- MT_init_lock(GDKbbpLock[i].trim, "GDKtrimLock");
+ MT_lock_init(&GDKbbpLock[i].alloc, "GDKcacheLock");
+ MT_lock_init(&GDKbbpLock[i].trim, "GDKtrimLock");
GDKbbpLock[i].free = 0;
}
- MT_init_lock(GDKnameLock, "GDKnameLock");
- MT_init_lock(GDKthreadLock, "GDKthreadLock");
- MT_init_lock(GDKunloadLock, "GDKunloadLock");
- MT_init_cond(GDKunloadCond, "GDKunloadCond");
- MT_init_lock(GDKtmLock, "GDKtmLock");
+ MT_lock_init(&GDKnameLock, "GDKnameLock");
+ MT_lock_init(&GDKthreadLock, "GDKthreadLock");
+ MT_lock_init(&GDKunloadLock, "GDKunloadLock");
+ MT_cond_init(&GDKunloadCond, "GDKunloadCond");
+ MT_lock_init(&GDKtmLock, "GDKtmLock");
malloc_lock_init();
GDKprotected = 1;
}
diff --git a/monetdb4/modules/contrib/qt.mx b/monetdb4/modules/contrib/qt.mx
--- a/monetdb4/modules/contrib/qt.mx
+++ b/monetdb4/modules/contrib/qt.mx
@@ -247,7 +247,7 @@
zid_t lid;
int n;
- MT_init_lock(qt_lock, "qt_lock");
+ MT_lock_init(&qt_lock, "qt_lock");
levels = (qtlevel_t *) GDKmalloc(nlevels * sizeof(qtlevel_t));
assert(levels);
@@ -348,13 +348,13 @@
{
int n;
- MT_set_lock(qt_lock, "qt_epilogue");
+ MT_lock_set(&qt_lock, "qt_epilogue");
for (n = 0; n != NCROSSES; n++)
if (crosses[n].c_crossid > 0) {
- MT_unset_lock(qt_lock, "qt_epilogue");
+ MT_lock_unset(&qt_lock, "qt_epilogue");
return;
}
- MT_destroy_lock(qt_lock);
+ MT_lock_destroy(&qt_lock);
for (n = 0; n != nlevels; n++) {
GDKfree(levels[n].lvl_idtoxy);
@@ -565,7 +565,7 @@
/* Now we have all the variables we need for the spot. Fill them
in a cross data structure. */
- MT_set_lock(qt_lock, "qt_makecross");
+ MT_lock_set(&qt_lock, "qt_makecross");
/* Find a free cross */
for (n = 0; n != NCROSSES; n++)
@@ -580,7 +580,7 @@
c = &crosses[n];
c->c_crossid = crossuniq++;
- MT_unset_lock(qt_lock, "qt_makecross");
+ MT_lock_unset(&qt_lock, "qt_makecross");
if (debug)
printf("makecross: hcenter %d, vcenter %d\n", hcenter, vcenter);
@@ -608,20 +608,20 @@
cross_t *c;
int n;
- MT_set_lock(qt_lock, "qt_delcross");
+ MT_lock_set(&qt_lock, "qt_delcross");
for (n = 0; n != NCROSSES; n++)
if (*crossid == crosses[n].c_crossid)
break;
if (n == NCROSSES) {
- MT_unset_lock(qt_lock, "qt_delcross");
+ MT_lock_unset(&qt_lock, "qt_delcross");
GDKerror("[qt_delcross]: Cross ID %d does not exist\n",
*crossid);
return GDK_FAIL;
}
c = &crosses[n];
if (c->c_refs > 0) {
- MT_unset_lock(qt_lock, "qt_delcross");
+ MT_lock_unset(&qt_lock, "qt_delcross");
GDKerror("[qt_delcross]: Cross %d busy\n", *crossid);
return GDK_FAIL;
@@ -632,7 +632,7 @@
GDKfree(c->c_spot);
memset(c, 0, sizeof(cross_t));
- MT_unset_lock(qt_lock, "qt_delcross");
+ MT_lock_unset(&qt_lock, "qt_delcross");
return GDK_SUCCEED;
}
@@ -710,25 +710,25 @@
if (debug)
printf("qt_match: number of features %d (lastid %d)\n",
nfeatures, lastid);
- MT_set_lock(qt_lock, "qt_match");
+ MT_lock_set(&qt_lock, "qt_match");
for (i = 0; i != NCROSSES; i++)
if (*crossid == crosses[i].c_crossid)
break;
if (i == NCROSSES) {
GDKerror("[qt_match]: Cross id %d does not exist\n", *crossid);
- MT_unset_lock(qt_lock, "qt_match");
+ MT_lock_unset(&qt_lock, "qt_match");
return GDK_FAIL;
}
c = &crosses[i];
if (c->c_cspace != (colorspace_t) *cspace) {
GDKerror("[qt_match]: Non matching color space (%d, %d)\n",
c->c_cspace, *cspace);
- MT_unset_lock(qt_lock, "qt_match");
+ MT_lock_unset(&qt_lock, "qt_match");
return GDK_FAIL;
}
c->c_refs++;
- MT_unset_lock(qt_lock, "qt_match");
+ MT_lock_unset(&qt_lock, "qt_match");
/* construct an in-core version of the quad tree */
quadtree = (gdk_int16 *) GDKmalloc(nfeatures * sizeof(gdk_int16));
@@ -1193,18 +1193,18 @@
bit initial;
printf("qt_cross_pre_select: Preselecting images\n");
- MT_set_lock(qt_lock, "qt_cross_pre_select");
+ MT_lock_set(&qt_lock, "qt_cross_pre_select");
for (n = 0; n != NCROSSES; n++)
if (crosses[n].c_crossid == *crossid)
break;
if (n == NCROSSES) {
GDKerror("[qt_cross_pre_select]: Cannot find cross %d\n",
*crossid);
- MT_unset_lock(qt_lock, "qt_cross_pre_select");
+ MT_lock_unset(&qt_lock, "qt_cross_pre_select");
return GDK_FAIL;
}
c = &crosses[n];
c->c_refs++;
- MT_unset_lock(qt_lock, "qt_cross_pre_select");
+ MT_lock_unset(&qt_lock, "qt_cross_pre_select");
printf("qt_cross_pre_select: allocating bitvector " SSZFMT "\n",
(ssize_t) *nimages);
/* Analyze the spot and select the right bit-fields. Allocate an
@@ -1288,18 +1288,18 @@
bit initial;
printf("qt_pre_select: Preselecting images\n");
- MT_set_lock(qt_lock, "qt_pre_select");
+ MT_lock_set(&qt_lock, "qt_pre_select");
for (n = 0; n != NCROSSES; n++)
if (crosses[n].c_crossid == *crossid)
break;
if (n == NCROSSES) {
GDKerror("[qt_pre_select]: Cannot find cross %d\n", *crossid);
- MT_unset_lock(qt_lock, "qt_pre_select");
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list