Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#5696 closed Bugs (fixed)

win32 detail::set_tss_data does nothing when tss_cleanup_function is NULL

Reported by: barney.wrightson@… Owned by: viboes
Milestone: Boost 1.52.0 Component: thread
Version: Boost 1.46.1 Severity: Regression
Keywords: thread_specific_ptr set_tss_data tss_cleanup_function win32 Cc: barney.wrightson@…

Description

Due to changes made in addressing Ticket #4736 when using a thread_specific_ptr that has been constructed with a NULL tss_cleanup_function, reset() will not set the data to anything. Previously this would work fine, with no cleanup function being called.

Looking at the documentation, behaviour is not specifically defined when the cleanup function is NULL, but the previous behaviour was consistent with how the pthreads implementation works, as well as being logical.

to fix line 597 of libs\thread\src\win32\thread.cpp should change from:

else if(func && tss_data)

to:

else

I don't think this was necessary to fix the original bug, but I haven't tested this. As there was another patch applied after the one that added this change, as the first patch caused other breakages maybe it was meant to have been reverted anyway (but wasn't).

Change History (5)

comment:1 by barney.wrightson@…, 11 years ago

Cc: barney.wrightson@… added

comment:2 by viboes, 11 years ago

Owner: changed from Anthony Williams to viboes
Status: newassigned

comment:3 by viboes, 10 years ago

Shouldn't the fix for 2797 fix this issue also?

Committed in trunk [80236].

comment:4 by viboes, 10 years ago

Milestone: To Be DeterminedBoost 1.52.0
Resolution: fixed
Status: assignedclosed

Merged to release [80450].

comment:5 by barney.wrightson@…, 10 years ago

Yes, it looks like the fix for 2797 resolves the issue.

Note: See TracTickets for help on using tickets.