aboutsummaryrefslogtreecommitdiff
path: root/src/wydawca.h
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-04-20 11:41:18 +0300
committerSergey Poznyakoff <gray@gnu.org>2020-04-20 11:41:18 +0300
commitce2bded4521255e3a0f7d2926d4198e75743af1d (patch)
treeb97924438f3309a172c0dd09aa1d1ba9e51819c6 /src/wydawca.h
parent84838fa69592cf37f97aaa918ad4e69b8bd4d62a (diff)
downloadwydawca-ce2bded4521255e3a0f7d2926d4198e75743af1d.tar.gz
wydawca-ce2bded4521255e3a0f7d2926d4198e75743af1d.tar.bz2
Rewrite the timer support.
Timers are kept in a thread-specific array variable. Spool timers are referenced in expansion strings by their fully qualified names, e.g. ${timer:spool:release:system}. * NEWS: Update. * doc/wydawca.texi: Document new syntax for the spool timer variables. * src/directive.c * src/wydawca.h (struct spool): New member: timer_id. * tests/upload-dry.at: Filter out certain messages, that can appear * src/process.c (spool_count): New global. (register_spool): Build spool list in the same order as listed in the configuration file. (spool_timer_id): New function. * src/timer.c: Rewrite using array of struct timer_slot, instead of the hash table. * src/triplet.c (try_timer_var): Rewrite. * src/wydawca.c (stderr_printer): Protect stderr by a mutex. in unpredictable order.
Diffstat (limited to 'src/wydawca.h')
-rw-r--r--src/wydawca.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/wydawca.h b/src/wydawca.h
index c48ea30..467daa0 100644
--- a/src/wydawca.h
+++ b/src/wydawca.h
@@ -231,6 +231,7 @@ struct virt_tab {
files from source to destination */
struct spool {
char *tag;
+ int timer_id;
struct grecs_list *aliases;
char *url; /* Download URL */
char *source_dir; /* Source directory */
@@ -313,11 +314,6 @@ extern int archive_signatures;
extern char *pidfile;
extern int force_startup;
-extern char *lockdir;
-extern time_t lock_expire_time;
-extern time_t lock_timeout;
-extern int enable_locking;
-
enum {
WY_MODE_NORMAL,
WY_MODE_CRON,
@@ -343,6 +339,8 @@ extern int inotify_enable;
extern struct notification *default_notification;
+extern size_t spool_count;
+
typedef unsigned WY_STAT_COUNTER;
WY_STAT_COUNTER *wy_get_stat_array(void);
@@ -514,14 +512,26 @@ int null_rmsymlink_file(struct wy_triplet *trp, const char *file_name);
/* timer.c */
typedef struct timer_slot *wydawca_timer_t;
-wydawca_timer_t timer_get(const char *name);
-wydawca_timer_t timer_start(const char *name);
-wydawca_timer_t timer_stop(const char *name);
-wydawca_timer_t timer_reset(const char *name);
+enum {
+ WY_TIMER_WYDAWCA,
+ WY_TIMER_TRIPLET,
+ WY_TIMER_SPOOL,
+ MY_TIMER_SPOOL_FIRST
+};
+
+wydawca_timer_t get_thread_timer_table(void);
+wydawca_timer_t get_thread_timer(int n);
+
+wydawca_timer_t timer_get(int);
+wydawca_timer_t timer_start(int);
+wydawca_timer_t timer_stop(int);
+wydawca_timer_t timer_reset(int);
double timer_get_real(wydawca_timer_t t);
double timer_get_user(wydawca_timer_t t);
double timer_get_system(wydawca_timer_t t);
char *timer_format_time(double t);
+int spool_timer_id(char *name);
+
void report_init(void);
void report_add(const char *fmt, ...);

Return to:

Send suggestions and report system problems to the System administrator.