2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
|
}
/*
** Respond to a SIGALRM by writing a message to the error log (if there
** is one) and exiting.
*/
#ifndef _WIN32
static void sigalrm_handler(int x){
fossil_panic("TIMEOUT");
}
#endif
/*
** Arrange to timeout using SIGALRM after N seconds. Or if N==0, cancel
** any pending timeout.
**
** Bugs:
** (1) This only works on unix systems.
** (2) Any call to sleep() or sqlite3_sleep() will cancel the alarm.
*/
void fossil_set_timeout(int N){
#ifndef _WIN32
signal(SIGALRM, sigalrm_handler);
alarm(N);
#endif
}
/*
** COMMAND: server*
** COMMAND: ui
**
|
>
>
>
|
>
>
|
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
|
}
/*
** Respond to a SIGALRM by writing a message to the error log (if there
** is one) and exiting.
*/
#ifndef _WIN32
static int nAlarmSeconds = 0;
static void sigalrm_handler(int x){
sqlite3_uint64 tmUser = 0, tmKernel = 0;
fossil_cpu_times(&tmUser, &tmKernel);
fossil_panic("Timeout after %d seconds - user %,llu µs, sys %,llu µs",
nAlarmSeconds, tmUser, tmKernel);
}
#endif
/*
** Arrange to timeout using SIGALRM after N seconds. Or if N==0, cancel
** any pending timeout.
**
** Bugs:
** (1) This only works on unix systems.
** (2) Any call to sleep() or sqlite3_sleep() will cancel the alarm.
*/
void fossil_set_timeout(int N){
#ifndef _WIN32
signal(SIGALRM, sigalrm_handler);
alarm(N);
nAlarmSeconds = N;
#endif
}
/*
** COMMAND: server*
** COMMAND: ui
**
|