Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,16 @@ void FiberSwitchImpl(ThreadState *from, ThreadState *to) {

ThreadState *FiberCreate(ThreadState *thr, uptr pc, unsigned flags) {
void *mem = Alloc(sizeof(ThreadState));
if ((flags & FiberSwitchFlagNoSync))
thr->ignore_sync++;
ThreadState *fiber = static_cast<ThreadState *>(mem);
internal_memset(fiber, 0, sizeof(*fiber));
Tid tid = ThreadCreate(thr, pc, 0, true);
FiberSwitchImpl(thr, fiber);
ThreadStart(fiber, tid, 0, ThreadType::Fiber);
FiberSwitchImpl(fiber, thr);
if ((flags & FiberSwitchFlagNoSync))
thr->ignore_sync--;
return fiber;
}

Expand All @@ -357,6 +361,8 @@ void FiberDestroy(ThreadState *thr, uptr pc, ThreadState *fiber) {

void FiberSwitch(ThreadState *thr, uptr pc,
ThreadState *fiber, unsigned flags) {
if (thr == fiber)
return;
if (!(flags & FiberSwitchFlagNoSync))
Release(thr, pc, (uptr)fiber);
FiberSwitchImpl(thr, fiber);
Expand Down
3 changes: 3 additions & 0 deletions openmp/runtime/src/ompt-specific.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,9 @@ int __ompt_get_task_memory_internal(void **addr, size_t *size, int blocknum) {
if (taskdata->td_flags.tasktype != TASK_EXPLICIT)
return 0; // support only explicit task

if (taskdata->td_size_alloc < 0)
return 0;

*addr = taskdata;
*size = taskdata->td_size_alloc;
return 0;
Expand Down
Loading