free_guid_list(jcr->id_list);
jcr->id_list = NULL;
}
- /* Invalidate the tsd jcr data */
- set_jcr_in_tsd(INVALID_JCR);
+ remove_jcr_from_tsd(jcr);
free(jcr);
}
Dmsg0(dbglvl, "Exit free_jcr\n");
}
+/*
+ * Remove jcr from thread specific data, but
+ * but make sure it is us who are attached.
+ */
+void remove_jcr_from_tsd(JCR *jcr)
+{
+ JCR *tjcr = get_gcr_from_tsd();
+ if (tjcr == jcr) {
+ set_jcr_in_tsd(INVALID_JCR);
+ }
+}
+
+/*
+ * Put this jcr in the thread specifc data
+ */
void set_jcr_in_tsd(JCR *jcr)
{
int status = pthread_setspecific(jcr_key, (void *)jcr);
}
}
+/*
+ * Give me the jcr that is attached to this thread
+ */
JCR *get_jcr_from_tsd()
{
JCR *jcr = (JCR *)pthread_getspecific(jcr_key);
#undef VERSION
#define VERSION "2.5.20"
-#define BDATE "22 November 2008"
-#define LSMDATE "22Nov08"
+#define BDATE "25 November 2008"
+#define LSMDATE "25Nov08"
#define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
#define BYEAR "2008" /* year for copyright messages in progs */
mixed priorities
General:
+25Nov08
+kes Ensure that consoles attach jcr to thread, and that only the
+ thread attached is removed from the TSD.
24Nov08
kes Move definition of FileId_t to bc_types and define it once in the jcr.
22Nov08