[Date Prev][Date Next] [Chronological] [Thread] [Top]

per-thread init for overlays?

I'm linking an external library with my overlay that needs per-process
initialization, which I handle in my overlay_init function. I clean that
initialization up in the on_bi.bi_destroy function. (Feel free to yell at
me if that's the wrong place, but it seems to work.)

My question is for thread-specific initialization. The external library
claims thread safety, but in addition to the process init() call, there is
a per-thread thread_init()/thread_end() call. They recommend,
unsurprisingly, placing this near a pthread_create()/pthread_destroy() or
moral equivalent. Is there any appropriate place to do this in the