2016-08-03 10:59:49 +00:00
<?xml version="1.0" encoding="utf-8"?>
2015-04-26 19:10:23 +01:00
< html xmlns = "http://www.w3.org/1999/xhtml" >
< head >
2016-08-03 10:59:49 +00:00
< title > mono-api-threads.html< / title >
< style type = "text/css" >
.mapi-docs {
line-height: 1.5;
padding-left: 2em;
padding-right: 2em;
}
.mapi-docs p {
max-width: 60em;
}
.mapi-docs .mapi-body {
max-width: 60em;
}
.mapi-docs code {
border: 1px solid rgba(214,214,214,1);
background-color: rgba(249,249,249,1);
padding: 0.1em 0.5em;
}
.mapi-description code {
font-family: "Consolas", "Courier", monospace;
border: 1px solid rgba(214,214,214,1);
background-color: rgba(249,249,249,1);
padding: 0.1em 0.2em;
}
.mapi-header {
padding: 0 0 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
border: 1px solid rgba(233,233,233,1);
background-color: rgba(249,249,249,1);
}
.mapi-code {
padding: 5pt 5pt;
margin: 10pt;
white-space: pre;
font-family: monospace;
border: 1px solid rgba(233,233,233,1);
background-color: rgba(249,249,249,1);
}
.mapi-code:first-line {
line-height: 0px;
}
.mapi-entry code {
border: none;
background-color: transparent;
}
2015-04-26 19:10:23 +01:00
2016-08-03 10:59:49 +00:00
.mapi-parameters {
border-collapse: collapse;
border-spacing: 0;
empty-cells: hide;
border: 0;
margin: 5px 0 26px;
}
.mapi-parameters td {
border: 1px solid rgba(214,214,214,1);
border-left-style: none;
padding: 5px 25px 5px 10px;
}
.mapi-parameters tr>td:last-child {
border-right: 0;
}
.mapi-parameters td:first-of-type {
text-align: right;
padding: 7px;
vertical-align: top;
word-break: normal;
width: 40px;
}
.mapi-parameters tr:last-child>td {
border-bottom: 0;
}
.mapi-parameters tr:first-child>td {
border-top: 0;
}
.mapi-parameters tr td:first-of-type {
text-align: right;
padding: 7px;
vertical-align: top;
word-break: normal;
width: 40px;
}
.mapi {
left: -25px;
margin: 0;
padding: 13px 25px 0;
position: relative;
width: 100%;
}
.mapi-description {
background: rgba(249,249,249,1);
border-bottom: 1px solid rgba(233,233,233,1);
left: -25px;
margin: 0;
padding: 13px 25px 0;
position: relative;
width: 100%;
}
.mapi-entry {
background: transparent;
}
.mapi-docs {
}
.mapi-prototype {
border-left: 5px solid rgba(205,233,244,1);
padding: .5em;
margin-top: 5pt;
margin-bottom: 5pt;
font-family: "Consolas", "Courier", monospace;
display: block;
overflow: auto;
background-color: #f9f9f9;
}
.mapi-declaration {
margin-top: 21px;
}
.mapi-section {
font-size: smaller;
font-weight: bold;
margin-top: 21px;
line-height: 1.5;
}
.mapi-strike {
text-decoration: line-through;
}
.mapi-deprecated {
color: red;
}
.mapi-ptr-container {
background: white;
border-bottom: 1px solid rgba(233,233,233,1);
left: -25px;
padding-left: 25px;
padding-right: 25px;
padding-bottom: 13px;
position: relative;
width: 100%;
}
.mapi-ptr {
background: rgba(249,249,249,1);
border-left: 1px solid rgba(233,233,233,1);
border-top: 1px solid rgba(233,233,233,1);
height: 12px;
left: 37px;
top: -7px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
position: absolute;
width: 12px;
}
.mapi-height-container {
left: -25px;
padding: 0 25px;
position: relative;
width: 100%;
}
2015-04-26 19:10:23 +01:00
< / style >
< / head >
< body >
2016-08-03 10:59:49 +00:00
< div class = "mapi-docs" >
2015-04-26 19:10:23 +01:00
< h2 > Working with threads< / h2 >
< h3 > Thread API< / h3 >
2016-08-03 10:59:49 +00:00
< a name = "api:mono_thread_attach" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_thread_attach< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_thread_attach< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_thread_create" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_thread_create< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_thread_create< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_thread_current" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_thread_current< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_thread_current< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_thread_detach" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_thread_detach< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_thread_detach< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_thread_exit" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_thread_exit< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_thread_exit< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_thread_get_managed_id" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_thread_get_managed_id< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_thread_get_managed_id< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_thread_get_name_utf8" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_thread_get_name_utf8< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_thread_get_name_utf8< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_thread_is_foreign" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_thread_is_foreign< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_thread_is_foreign< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_thread_manage" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_thread_manage< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_thread_manage< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_thread_new_init" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_thread_new_init< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_thread_new_init< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_threads_get_default_stacksize" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_threads_get_default_stacksize< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_threads_get_default_stacksize< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_threads_set_default_stacksize" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_threads_set_default_stacksize< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_threads_set_default_stacksize< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_thread_set_manage_callback" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_thread_set_manage_callback< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_thread_set_manage_callback< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_thread_stop" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_thread_stop< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_thread_stop< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_thread_get_main" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_thread_get_main< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_thread_get_main< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_thread_set_main" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_thread_set_main< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > void
2015-04-26 19:10:23 +01:00
mono_thread_set_main (MonoThread *thread)
< / div >
2016-08-03 10:59:49 +00:00
< p / >
< div class = "mapi-section" > Parameters< / div >
< table class = "mapi-parameters" > < tbody > < tr > < td > < i > thread< / i > < td > thread to set as the main thread< / td > < / td > < / tr > < / tbody > < / table > < div class = "mapi-section" > Description< / div >
< div > < p / >
2015-04-26 19:10:23 +01:00
This function can be used to instruct the runtime to treat < i > thread< / i >
as the main thread, ie, the thread that would normally execute the Main()
method. This basically means that at the end of < i > thread< / i > , the runtime will
2016-08-03 10:59:49 +00:00
wait for the existing foreground threads to quit and other such details.< / div >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< h3 > Monitors< / h3 >
< / div > <!-- class=mapi -->
< a name = "api:mono_monitor_enter" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_monitor_enter< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_monitor_enter< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_monitor_enter_v4" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_monitor_enter_v4< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_monitor_enter_v4< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_monitor_exit" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_monitor_exit< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_monitor_exit< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_monitor_try_enter" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_monitor_try_enter< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_monitor_try_enter< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< h3 > Initialization and Shutdown< / h3 >
< / div > <!-- class=mapi -->
< a name = "api:mono_thread_cleanup" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_thread_cleanup< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_thread_cleanup< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div > <!-- class=mapi -->
< a name = "api:mono_thread_detach_if_exiting" > < / a >
< div class = "mapi" >
< div class = "mapi-entry " > < code > mono_thread_detach_if_exiting< / code > < / div >
< div class = "mapi-height-container" >
< div class = "mapi-ptr-container" > < / div >
< div class = "mapi-description" >
< div class = "mapi-ptr" > < / div >
< div class = "mapi-declaration mapi-section" > Syntax< / div >
< div class = "mapi-prototype" > mono_thread_detach_if_exiting< / div >
< p / >
< / div > <!-- mapi - description -->
< / div > <!-- height container -->
< / div >
2015-04-26 19:10:23 +01:00
< / div > < / body >
< / html >