Skip to content

Commit d3a2902

Browse files
jfsmigfvennetier
authored andcommitted
gridinit/log: no need to compute a thread id
1 parent c79bad6 commit d3a2902

File tree

2 files changed

+6
-20
lines changed

2 files changed

+6
-20
lines changed

main/children.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -712,9 +712,9 @@ supervisor_children_catharsis(void *udata, supervisor_cb_f cb)
712712
void
713713
supervisor_children_stopall(guint max_retries)
714714
{
715-
struct child_s *sd;
716715
guint retries;
717716

717+
struct child_s *sd;
718718
FOREACH_CHILD(sd) {
719719
FLAG_DEL(sd, MASK_STARTED);
720720
}
@@ -816,11 +816,11 @@ supervisor_children_register(const gchar *key, const gchar *cmd)
816816
gint
817817
supervisor_run_services(void *udata, supervisor_run_cb_f callback)
818818
{
819-
struct child_s *sd;
820819
gint count = 0U;
821820

822821
g_assert_nonnull(callback);
823822

823+
struct child_s *sd;
824824
FOREACH_CHILD(sd) {
825825
struct child_info_s ci = {};
826826
if (FLAG_HAS(sd, MASK_OBSOLETE))
@@ -837,9 +837,9 @@ supervisor_run_services(void *udata, supervisor_run_cb_f callback)
837837
guint
838838
supervisor_children_kill_disabled(void)
839839
{
840-
struct child_s *sd;
841840
guint count = 0U;
842841

842+
struct child_s *sd;
843843
FOREACH_CHILD(sd) {
844844
/* Stop child that needs to be restarted */
845845
if (FLAG_HAS(sd,MASK_RESTART))

main/gridinit.c

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,20 +1228,6 @@ _cfg_reload(gboolean services_only, GError **err)
12281228

12291229
/* ------------------------------------------------------------------------- */
12301230

1231-
static guint16
1232-
compute_thread_id(GThread *thread)
1233-
{
1234-
union { void *p; guint16 u[4]; } bulk = {};
1235-
bulk.p = thread;
1236-
return (bulk.u[0] ^ bulk.u[1]) ^ (bulk.u[2] ^ bulk.u[3]);
1237-
}
1238-
1239-
static guint16
1240-
get_thread_id(void)
1241-
{
1242-
return compute_thread_id(g_thread_self());
1243-
}
1244-
12451231
static int
12461232
glvl_to_lvl(GLogLevelFlags lvl)
12471233
{
@@ -1332,7 +1318,7 @@ logger_syslog(const gchar *log_domain, GLogLevelFlags log_level,
13321318

13331319
GString *gstr = g_string_new("");
13341320

1335-
g_string_append_printf(gstr, "%d %04X", getpid(), get_thread_id());
1321+
g_string_append_printf(gstr, "%d 0000", getpid());
13361322

13371323
if (!log_domain || !*log_domain)
13381324
log_domain = "-";
@@ -1364,9 +1350,9 @@ logger_stderr(const gchar *log_domain, GLogLevelFlags log_level,
13641350
gstr = g_string_sized_new(256);
13651351
gettimeofday(&tv, NULL);
13661352

1367-
g_string_append_printf(gstr, "%ld.%03ld %d %04X ",
1353+
g_string_append_printf(gstr, "%ld.%03ld %d 0000 ",
13681354
tv.tv_sec, tv.tv_usec/1000,
1369-
getpid(), get_thread_id());
1355+
getpid());
13701356

13711357
if (!log_domain || !*log_domain)
13721358
log_domain = "-";

0 commit comments

Comments
 (0)