summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authormonty@narttu.mysql.fi <>2003-06-05 17:33:38 +0300
committermonty@narttu.mysql.fi <>2003-06-05 17:33:38 +0300
commit7a54334443d98bd5830efb359cdfc16330d45c10 (patch)
tree2f66999790d27b10bd1ddb8bdc47741a04c5c502 /mysys
parentdad0664579410c9e2b4d2a310becec239f8ae8a8 (diff)
parente6cdc816137b679e4c8d7c333eacf48d6afa1622 (diff)
downloadmariadb-git-7a54334443d98bd5830efb359cdfc16330d45c10.tar.gz
Merge with 4.0.13
Diffstat (limited to 'mysys')
-rw-r--r--mysys/thr_alarm.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index a2647ec7399..7a845e3eb00 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -122,12 +122,24 @@ void init_thr_alarm(uint max_alarms)
/*
Request alarm after sec seconds.
- A pointer is returned with points to a non-zero int when the alarm has been
- given. This can't be called from the alarm-handling thread.
- Returns 0 if no more alarms are allowed (aborted by process)
+
+ SYNOPSIS
+ thr_alarm()
+ alrm Pointer to alarm detection
+ alarm_data Structure to store in alarm queue
+
+ NOTES
+ This function can't be called from the alarm-handling thread.
+
+ RETURN VALUES
+ 0 ok
+ 1 If no more alarms are allowed (aborted by process)
+
+ Stores in first argument a pointer to a non-zero int which is set to 0
+ when the alarm has been given
*/
-bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
+my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
{
ulong now;
sigset_t old_mask;
@@ -209,7 +221,7 @@ void thr_end_alarm(thr_alarm_t *alarmed)
ALARM *alarm_data;
sigset_t old_mask;
uint i;
- bool found=0;
+ my_bool found=0;
DBUG_ENTER("thr_end_alarm");
pthread_sigmask(SIG_BLOCK,&full_signal_set,&old_mask);
@@ -230,10 +242,9 @@ void thr_end_alarm(thr_alarm_t *alarmed)
DBUG_ASSERT(!*alarmed || found);
if (!found)
{
-#ifdef MAIN
- printf("Warning: Didn't find alarm %lx in queue of %d alarms\n",
- (long) *alarmed, alarm_queue.elements);
-#endif
+ if (*alarmed)
+ fprintf(stderr,"Warning: Didn't find alarm %lx in queue of %d alarms\n",
+ (long) *alarmed, alarm_queue.elements);
DBUG_PRINT("warning",("Didn't find alarm %lx in queue\n",
(long) *alarmed));
}