-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ST: Replace macros with explicit code for better understanding. v7.0.7 (
#4149) Improvements for ST(State Threads): 1. ST: Use g++ for CXX compiler. 2. ST: Remove macros for clist. 3. ST: Remove macros for global thread and vp. 4. ST: Remove macros for vp queue operations. 5. ST: Remove macros for context switch. 6. ST: Remove macros for setjmp/longjmp. 7. ST: Remove macro for stack pad. 8. ST: Refine macro for valgrind. --------- Co-authored-by: Jacob Su <suzp1984@gmail.com>
- Loading branch information
Showing
15 changed files
with
228 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* SPDX-License-Identifier: MIT */ | ||
/* Copyright (c) 2021-2022 The SRS Authors */ | ||
|
||
#include "common.h" | ||
|
||
void _st_switch_context(_st_thread_t *thread) | ||
{ | ||
ST_SWITCH_OUT_CB(thread); | ||
|
||
if (!_st_md_cxt_save(thread->context)) { | ||
_st_vp_schedule(); | ||
} | ||
|
||
ST_DEBUG_ITERATE_THREADS(); | ||
ST_SWITCH_IN_CB(thread); | ||
} | ||
|
||
void _st_restore_context(_st_thread_t *thread) | ||
{ | ||
_st_this_thread = thread; | ||
_st_md_cxt_restore(thread->context, 1); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.