POSIX key destruction (possibly a bug?)

Phil Torre ptorre at zetron.com
Wed Dec 11 00:24:25 UTC 2002


The saga of porting ACE to RTEMS continues...

My current problem involves _POSIX_Keys_Run_destructors().  A thread
has created a key, and is now exiting.  The key's value is a pointer
to malloc'd storage, so the destructor is run and the storage is
free'd.  We then check the value again, and since it hasn't changed
we set are_all_null to FALSE, loop, and try to free the same block
again.

Should this function set the_key->Values[pthread_class][pthread_index]
to NULL after calling the destructor?  That seems like the right thing
to me, but I'm fairly ignorant of POSIX internals and thought I'd best
run it past the experts.  :)

-- 

=====================================================================
Phil Torre                               phone: 425-820-6363 x234
Design Engineer                          email: ptorre at zetron.com
Switching Systems Group                    fax: 425-820-7031
Zetron, Inc.                               web: http://www.zetron.com


  




More information about the users mailing list