Skip to content

Commit

Permalink
Force stack re-alignment for entry-points from phread_create with min…
Browse files Browse the repository at this point in the history
…gw & windows to fix SSE crashes in child threads
  • Loading branch information
simtr committed Aug 15, 2014
1 parent 7e9c507 commit a629eb9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/Config.h
Expand Up @@ -173,7 +173,15 @@
#define TPT_INLINE inline
#endif

#if

#define SDEUT
//#define REALHEAT

#if defined(WIN) && defined(__GNUC__)
#define TH_ENTRY_POINT __attribute__((force_align_arg_pointer))
#else
#define TH_ENTRY_POINT
#endif

#endif /* CONFIG_H */
2 changes: 1 addition & 1 deletion src/client/requestbroker/RequestBroker.cpp
Expand Up @@ -141,7 +141,7 @@ void RequestBroker::RetrieveImage(std::string imageUrl, int width, int height, R
assureRunning();
}

void * RequestBroker::thumbnailQueueProcessHelper(void * ref)
TH_ENTRY_POINT void * RequestBroker::thumbnailQueueProcessHelper(void * ref)
{
((RequestBroker*)ref)->thumbnailQueueProcessTH();
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/search/SearchModel.cpp
Expand Up @@ -29,7 +29,7 @@ bool SearchModel::GetShowTags()
return showTags;
}

void * SearchModel::updateSaveListTHelper(void * obj)
TH_ENTRY_POINT void * SearchModel::updateSaveListTHelper(void * obj)
{
return ((SearchModel *)obj)->updateSaveListT();
}
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/Gravity.cpp
Expand Up @@ -127,7 +127,7 @@ void Gravity::gravity_update_async()
}
}

void *Gravity::update_grav_async_helper(void * context)
TH_ENTRY_POINT void *Gravity::update_grav_async_helper(void * context)
{
((Gravity *)context)->update_grav_async();
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/Task.cpp
Expand Up @@ -122,7 +122,7 @@ void Task::after()

}

void * Task::doWork_helper(void * ref)
TH_ENTRY_POINT void * Task::doWork_helper(void * ref)
{
bool newSuccess = ((Task*)ref)->doWork();
pthread_mutex_lock(&((Task*)ref)->taskMutex);
Expand Down

0 comments on commit a629eb9

Please sign in to comment.