Skip to content

Commit

Permalink
doc for: posix: use pthread_key_create() to cleanup epicsThreadOSD
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavidsaver committed May 11, 2022
1 parent dd0939d commit 0d5cbeb
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
14 changes: 14 additions & 0 deletions documentation/RELEASE_NOTES.md
Expand Up @@ -17,6 +17,20 @@ should also be read to understand what has changed since earlier releases.
<!-- Insert new items immediately below here ... -->


### Fixed leak from a non-EPICS thread

On some targets, if a thread not created by `epicsThreadCreate*()` directly
or indirectly calls an `epicsThread*()` function, a specific tracking struct
is allocated.

Prior to this release, on POSIX and WIN32 targets, this
struct would not be `free()`d, resulting in a memory leak.

This release fixed the leak on POSIX targets.

See the associated github [issue 241](https://github.com/epics-base/epics-base/issues/241)
for WIN32 status.

### Fix `CHECK_RELEASE = WARN`

This now works again, it was broken in 2019 (7.0.3.1) by an errant commit.
Expand Down
3 changes: 1 addition & 2 deletions modules/libcom/src/osi/os/RTEMS-score/osdThread.c
Expand Up @@ -219,8 +219,7 @@ threadWrapper (rtems_task_argument arg)
*/
void epicsThreadExitMain (void)
{
cantProceed("epicsThreadExitMain() has been deprecated for lack of usage."
" Please report if you see this message.");
cantProceed("epicsThreadExitMain() must no longer be used.\n");
}

static rtems_status_code
Expand Down
3 changes: 1 addition & 2 deletions modules/libcom/src/osi/os/WIN32/osdThread.c
Expand Up @@ -256,8 +256,7 @@ static void epicsParmCleanupWIN32 ( void * praw )
*/
LIBCOM_API void epicsStdCall epicsThreadExitMain ( void )
{
cantProceed("epicsThreadExitMain() has been deprecated for lack of usage."
" Please report if you see this message.");
cantProceed("epicsThreadExitMain() must no longer be used.\n");
}

/*
Expand Down
3 changes: 1 addition & 2 deletions modules/libcom/src/osi/os/posix/osdThread.c
Expand Up @@ -723,8 +723,7 @@ LIBCOM_API void epicsStdCall epicsThreadExitMain(void)

epicsThreadInit();

cantProceed("epicsThreadExitMain() has been deprecated for lack of usage."
" Please report if you see this message.");
cantProceed("epicsThreadExitMain() must no longer be used.\n");

pthreadInfo = (epicsThreadOSD *)pthread_getspecific(getpthreadInfo);
if(pthreadInfo==NULL)
Expand Down
3 changes: 1 addition & 2 deletions modules/libcom/src/osi/os/vxWorks/osdThread.c
Expand Up @@ -353,8 +353,7 @@ void epicsThreadResume(epicsThreadId id)

void epicsThreadExitMain(void)
{
cantProceed("epicsThreadExitMain() has been deprecated for lack of usage."
" Please report if you see this message.");
cantProceed("epicsThreadExitMain() must no longer be used.\n");
}

unsigned int epicsThreadGetPriority(epicsThreadId id)
Expand Down

0 comments on commit 0d5cbeb

Please sign in to comment.