[common] properly define _GNU_SOURCE and set the thread names

This commit is contained in:
Geoffrey McRae 2020-08-10 16:22:02 +10:00
parent 90d0cd873d
commit d9a80b16f0
4 changed files with 6 additions and 3 deletions

View File

@ -1 +1 @@
B2-rc3-0-g82e0b7b6ab+1
B2-rc3-1-g90d0cd873d+1

View File

@ -5,6 +5,8 @@ include_directories(
${PROJECT_SOURCE_DIR}/include
)
add_definitions(-D_GNU_SOURCE)
if(ENABLE_BACKTRACE)
add_definitions(-DENABLE_BACKTRACE)
endif()

View File

@ -17,7 +17,6 @@ this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define _GNU_SOURCE
#include "common/crash.h"
#include "common/debug.h"

View File

@ -54,6 +54,8 @@ bool lgCreateThread(const char * name, LGThreadFunction function, void * opaque,
*handle = NULL;
return false;
}
pthread_setname_np((*handle)->handle, name);
return true;
}
@ -71,4 +73,4 @@ bool lgJoinThread(LGThread * handle, int * resultCode)
free(handle);
return true;
}
}