Changeset: dc2c19d9f426 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/dc2c19d9f426
Branch: default
Log Message:
Merge with Jun2023 branch.
diffs (truncated from 1290 to 300 lines):
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -272,7 +272,7 @@ void GDKclrerr(void);
gdk_return GDKcopyenv(BAT **key, BAT **val, bool writable);
gdk_return GDKcreatedir(const char *nme);
gdk_return GDKcreatesem(int id, int count, int *semid);
-int GDKdebug;
+ATOMIC_TYPE GDKdebug;
bool GDKembedded(void);
bool GDKexiting(void);
_Noreturn void GDKfatal(_In_z_ _Printf_format_string_ const char *format, ...)
__attribute__((__format__(__printf__, 1, 2)));
@@ -281,7 +281,7 @@ bit GDKfataljumpenable;
str GDKfatalmsg;
char *GDKfilepath(int farmid, const char *dir, const char *nme, const char
*ext);
void GDKfree(void *blk);
-int GDKgetdebug(void);
+unsigned GDKgetdebug(void);
const char *GDKgetenv(const char *name);
int GDKgetenv_int(const char *name, int def);
bool GDKgetenv_istext(const char *name, const char *text);
@@ -315,7 +315,7 @@ gdk_return GDKrebuild_segment_tree(oid n
gdk_return GDKreleasemmap(void *ptr, size_t size, size_t id);
gdk_return GDKreleasesem(int sem_id);
void GDKreset(int status);
-void GDKsetdebug(int debug);
+void GDKsetdebug(unsigned debug);
gdk_return GDKsetenv(const char *name, const char *value);
void GDKsetmallocsuccesscount(lng count);
ssize_t GDKstrFromStr(unsigned char *restrict dst, const unsigned char
*restrict src, ssize_t len, char quote);
@@ -559,7 +559,7 @@ gdk_return log_tend(logger *lg);
gdk_return log_tflush(logger *lg, ulng log_file_id, ulng commit_ts);
gdk_return log_tsequence(logger *lg, int seq, lng id);
gdk_return log_tstart(logger *lg, bool flushnow, ulng *log_file_id);
-log_level_t lvl_per_component[];
+ATOMIC_TYPE lvl_per_component[];
void *mdlopen(const char *library, int mode);
const char *mercurial_revision(void) __attribute__((__const__));
int mo_add_option(opt **Set, int setlen, opt_kind kind, const char *name,
const char *value);
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -380,40 +380,40 @@ gdk_export _Noreturn void GDKfatal(_In_z
for a documentation of the following debug options.
*/
-#define THRDMASK (1)
-#define CHECKMASK (1<<1)
-#define CHECKDEBUG if (GDKdebug & CHECKMASK)
-#define PROPMASK (1<<3) /* unused */
-#define PROPDEBUG if (GDKdebug & PROPMASK) /* unused */
-#define IOMASK (1<<4)
-#define BATMASK (1<<5)
-#define PARMASK (1<<7)
-#define TMMASK (1<<9)
-#define TEMMASK (1<<10)
-#define PERFMASK (1<<12)
-#define DELTAMASK (1<<13)
-#define LOADMASK (1<<14)
-#define PUSHCANDMASK (1<<15) /* used in opt_pushselect.c */
-#define TAILCHKMASK (1<<16) /* check .tail file size during commit */
-#define ACCELMASK (1<<20)
-#define ALGOMASK (1<<21)
+#define THRDMASK (1U)
+#define CHECKMASK (1U<<1)
+#define CHECKDEBUG if (ATOMIC_GET(&GDKdebug) & CHECKMASK)
+#define PROPMASK (1U<<3) /* unused */
+#define PROPDEBUG if (ATOMIC_GET(&GDKdebug) & PROPMASK) /* unused */
+#define IOMASK (1U<<4)
+#define BATMASK (1U<<5)
+#define PARMASK (1U<<7)
+#define TMMASK (1U<<9)
+#define TEMMASK (1U<<10)
+#define PERFMASK (1U<<12)
+#define DELTAMASK (1U<<13)
+#define LOADMASK (1U<<14)
+#define PUSHCANDMASK (1U<<15) /* used in opt_pushselect.c */
+#define TAILCHKMASK (1U<<16) /* check .tail file size during commit
*/
+#define ACCELMASK (1U<<20)
+#define ALGOMASK (1U<<21)
-#define NOSYNCMASK (1<<24)
+#define NOSYNCMASK (1U<<24)
-#define DEADBEEFMASK (1<<25)
-#define DEADBEEFCHK if (!(GDKdebug & DEADBEEFMASK))
+#define DEADBEEFMASK (1U<<25)
+#define DEADBEEFCHK if (!(ATOMIC_GET(&GDKdebug) & DEADBEEFMASK))
-#define ALLOCMASK (1<<26)
+#define ALLOCMASK (1U<<26)
/* M5, only; cf.,
* monetdb5/mal/mal.h
*/
-#define OPTMASK (1<<27)
+#define OPTMASK (1U<<27)
-#define HEAPMASK (1<<28)
+#define HEAPMASK (1U<<28)
-#define FORCEMITOMASK (1<<29)
-#define FORCEMITODEBUG if (GDKdebug & FORCEMITOMASK)
+#define FORCEMITOMASK (1U<<29)
+#define FORCEMITODEBUG if (ATOMIC_GET(&GDKdebug) & FORCEMITOMASK)
#ifndef TRUE
#define TRUE true
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -1585,9 +1585,9 @@ BBPinit(void)
bat nhashbats = 0;
gdk_return res = GDK_SUCCEED;
#endif
- int dbg = GDKdebug;
-
- GDKdebug &= ~TAILCHKMASK;
+ ATOMIC_BASE_TYPE dbg = ATOMIC_GET(&GDKdebug);
+
+ ATOMIC_AND(&GDKdebug, ~TAILCHKMASK);
/* the maximum number of BATs allowed in the system and the
* size of the "physical" array are linked in a complicated
@@ -1606,7 +1606,7 @@ BBPinit(void)
if ((bbpdirstr = GDKfilepath(0, BATDIR, "BBP", "dir")) == NULL)
{
TRC_CRITICAL(GDK, "GDKmalloc failed\n");
BBPtmunlock();
- GDKdebug = dbg;
+ ATOMIC_SET(&GDKdebug, dbg);
return GDK_FAIL;
}
@@ -1614,7 +1614,7 @@ BBPinit(void)
GDKfree(bbpdirstr);
TRC_CRITICAL(GDK, "GDKmalloc failed\n");
BBPtmunlock();
- GDKdebug = dbg;
+ ATOMIC_SET(&GDKdebug, dbg);
return GDK_FAIL;
}
@@ -1623,7 +1623,7 @@ BBPinit(void)
GDKfree(backupbbpdirstr);
TRC_CRITICAL(GDK, "cannot remove directory %s\n",
TEMPDIR);
BBPtmunlock();
- GDKdebug = dbg;
+ ATOMIC_SET(&GDKdebug, dbg);
return GDK_FAIL;
}
@@ -1632,7 +1632,7 @@ BBPinit(void)
GDKfree(backupbbpdirstr);
TRC_CRITICAL(GDK, "cannot remove directory %s\n",
DELDIR);
BBPtmunlock();
- GDKdebug = dbg;
+ ATOMIC_SET(&GDKdebug, dbg);
return GDK_FAIL;
}
@@ -1642,7 +1642,7 @@ BBPinit(void)
GDKfree(backupbbpdirstr);
TRC_CRITICAL(GDK, "cannot properly recover_subdir
process %s.", SUBDIR);
BBPtmunlock();
- GDKdebug = dbg;
+ ATOMIC_SET(&GDKdebug, dbg);
return GDK_FAIL;
}
@@ -1660,7 +1660,7 @@ BBPinit(void)
GDKfree(backupbbpdirstr);
TRC_CRITICAL(GDK, "cannot open recovered
BBP.dir.");
BBPtmunlock();
- GDKdebug = dbg;
+ ATOMIC_SET(&GDKdebug, dbg);
return GDK_FAIL;
}
} else if ((fp = GDKfilelocate(0, "BBP", "r", "dir")) == NULL) {
@@ -1705,7 +1705,7 @@ BBPinit(void)
lng logno, transid;
bbpversion = BBPheader(fp, &lineno, &bbpsize, &logno, &transid);
if (bbpversion == 0) {
- GDKdebug = dbg;
+ ATOMIC_SET(&GDKdebug, dbg);
return GDK_FAIL;
}
assert(bbpversion > GDKLIBRARY_MINMAX_POS || logno == 0);
@@ -1716,7 +1716,7 @@ BBPinit(void)
/* allocate BBP records */
if (BBPextend(bbpsize) != GDK_SUCCEED) {
- GDKdebug = dbg;
+ ATOMIC_SET(&GDKdebug, dbg);
return GDK_FAIL;
}
ATOMIC_SET(&BBPsize, bbpsize);
@@ -1727,7 +1727,7 @@ BBPinit(void)
, &hashbats, &nhashbats
#endif
) != GDK_SUCCEED) {
- GDKdebug = dbg;
+ ATOMIC_SET(&GDKdebug, dbg);
return GDK_FAIL;
}
fclose(fp);
@@ -1743,7 +1743,7 @@ BBPinit(void)
GDKfree(hashbats);
#endif
TRC_CRITICAL(GDK, "cannot properly prepare process
%s.", BAKDIR);
- GDKdebug = dbg;
+ ATOMIC_SET(&GDKdebug, dbg);
return rc;
}
}
@@ -1752,7 +1752,7 @@ BBPinit(void)
#ifdef GDKLIBRARY_HASHASH
GDKfree(hashbats);
#endif
- GDKdebug = dbg;
+ ATOMIC_SET(&GDKdebug, dbg);
return GDK_FAIL;
}
@@ -1765,7 +1765,7 @@ BBPinit(void)
#ifdef GDKLIBRARY_HASHASH
GDKfree(hashbats);
#endif
- GDKdebug = dbg;
+ ATOMIC_SET(&GDKdebug, dbg);
return GDK_FAIL;
}
if (bbpversion <= GDKLIBRARY_TAILN) {
@@ -1778,7 +1778,7 @@ BBPinit(void)
#ifdef GDKLIBRARY_HASHASH
GDKfree(hashbats);
#endif
- GDKdebug = dbg;
+ ATOMIC_SET(&GDKdebug, dbg);
return GDK_FAIL;
}
close(fd);
@@ -1799,7 +1799,7 @@ BBPinit(void)
#ifdef GDKLIBRARY_HASHASH
GDKfree(hashbats);
#endif
- GDKdebug = dbg;
+ ATOMIC_SET(&GDKdebug, dbg);
return GDK_FAIL;
}
}
@@ -1816,7 +1816,7 @@ BBPinit(void)
if (bbpversion < GDKLIBRARY && TMcommit() != GDK_SUCCEED) {
TRC_CRITICAL(GDK, "TMcommit failed\n");
- GDKdebug = dbg;
+ ATOMIC_SET(&GDKdebug, dbg);
return GDK_FAIL;
}
@@ -1831,7 +1831,7 @@ BBPinit(void)
* above */
if (movestrbats() != GDK_SUCCEED) {
GDKfree(needstrbatmove);
- GDKdebug = dbg;
+ ATOMIC_SET(&GDKdebug, dbg);
return GDK_FAIL;
}
MT_remove(needstrbatmove);
@@ -1839,7 +1839,7 @@ BBPinit(void)
needstrbatmove = NULL;
}
#endif
- GDKdebug = dbg;
+ ATOMIC_SET(&GDKdebug, dbg);
/* cleanup any leftovers (must be done after BBPrecover) */
for (i = 0; i < MAXFARMS && BBPfarms[i].dirname != NULL; i++) {
@@ -2193,7 +2193,7 @@ BBPdir_last(int n, char *buf, size_t buf
}
}
if (fflush(nbbpf) == EOF ||
- (!(GDKdebug & NOSYNCMASK)
+ (!(ATOMIC_GET(&GDKdebug) & NOSYNCMASK)
#if defined(NATIVE_WIN32)
&& _commit(_fileno(nbbpf)) < 0
#elif defined(HAVE_FDATASYNC)
@@ -3030,7 +3030,7 @@ BBPkeepref(BAT *b)
BATsettrivprop(b);
MT_lock_unset(&b->theaplock);
}
- if (GDKdebug & CHECKMASK)
+ if (ATOMIC_GET(&GDKdebug) & CHECKMASK)
BATassertProps(b);
if (BATsetaccess(b, BAT_READ) == NULL)
return; /* already decreffed */
@@ -3750,7 +3750,7 @@ BBPsync(int cnt, bat *restrict subcommit
TRC_DEBUG_IF(PERF) t0 = t1 = GDKusec();
- if ((GDKdebug & TAILCHKMASK) && !GDKinmemory(0))
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]