<?xml version='1.0' encoding='UTF-8' standalone='no'?> <doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.16"> <compounddef id="ubthread_8c" kind="file" language="C++"> <compoundname>ubthread.c</compoundname> <includes refid="ubthread_8h" local="no">ubixos/ubthread.h</includes> <includes refid="exec_8h" local="no">ubixos/exec.h</includes> <includes refid="sched_8h" local="no">ubixos/sched.h</includes> <includes refid="time_8h" local="no">ubixos/time.h</includes> <includes refid="spinlock_8h" local="no">ubixos/spinlock.h</includes> <includes refid="vitals_8h" local="no">ubixos/vitals.h</includes> <includes refid="kmalloc_8h" local="no">lib/kmalloc.h</includes> <includes refid="kprintf_8h" local="no">lib/kprintf.h</includes> <includes refid="kpanic_8h" local="no">ubixos/kpanic.h</includes> <includes refid="stdatomic_8h" local="no">sys/stdatomic.h</includes> <incdepgraph> <node id="22"> <label>ufs/ufs.h</label> <link refid="ufs_8h"/> <childnode refid="3" relation="include"> </childnode> <childnode refid="23" relation="include"> </childnode> </node> <node id="42"> <label>stdarg.h</label> <link refid="stdarg_8h"/> </node> <node id="43"> <label>ubixos/kpanic.h</label> <link refid="kpanic_8h"/> </node> <node id="56"> <label>sys/stdatomic.h</label> <link refid="stdatomic_8h"/> <childnode refid="6" relation="include"> </childnode> <childnode refid="4" relation="include"> </childnode> </node> <node id="26"> <label>sys/tss.h</label> <link refid="tss_8h"/> <childnode refid="3" relation="include"> </childnode> </node> <node id="28"> <label>sys/io.h</label> <link refid="io_8h"/> </node> <node id="49"> <label>net/pbuf.h</label> <link refid="pbuf_8h"/> <childnode refid="36" relation="include"> </childnode> <childnode refid="44" relation="include"> </childnode> </node> <node id="25"> <label>ubixos/tty.h</label> <link refid="tty_8h"/> <childnode refid="3" relation="include"> </childnode> </node> <node id="34"> <label>net/net.h</label> <link refid="net_8h"/> <childnode refid="3" relation="include"> </childnode> <childnode refid="35" relation="include"> </childnode> </node> <node id="54"> <label>net/priv/memp_priv.h</label> <link refid="memp__priv_8h"/> <childnode refid="36" relation="include"> </childnode> <childnode refid="51" relation="include"> </childnode> </node> <node id="15"> <label>i386/cpu.h</label> <link refid="i386_2cpu_8h"/> <childnode refid="3" relation="include"> </childnode> </node> <node id="5"> <label>sys/select.h</label> <link refid="select_8h"/> <childnode refid="6" relation="include"> </childnode> <childnode refid="4" relation="include"> </childnode> <childnode refid="7" relation="include"> </childnode> <childnode refid="8" relation="include"> </childnode> <childnode refid="9" relation="include"> </childnode> </node> <node id="18"> <label>vfs/inode.h</label> <link refid="inode_8h"/> <childnode refid="3" relation="include"> </childnode> <childnode refid="19" relation="include"> </childnode> <childnode refid="20" relation="include"> </childnode> <childnode refid="21" relation="include"> </childnode> <childnode refid="22" relation="include"> </childnode> </node> <node id="2"> <label>ubixos/ubthread.h</label> <link refid="ubthread_8h"/> <childnode refid="3" relation="include"> </childnode> <childnode refid="10" relation="include"> </childnode> <childnode refid="27" relation="include"> </childnode> </node> <node id="30"> <label>ubixos/spinlock.h</label> <link refid="spinlock_8h"/> <childnode refid="3" relation="include"> </childnode> </node> <node id="40"> <label>net/arch/cc.h</label> <link refid="cc_8h"/> <childnode refid="27" relation="include"> </childnode> </node> <node id="9"> <label>sys/_sigset.h</label> <link refid="__sigset_8h"/> <childnode refid="4" relation="include"> </childnode> </node> <node id="31"> <label>ubixos/vitals.h</label> <link refid="vitals_8h"/> <childnode refid="3" relation="include"> </childnode> <childnode refid="30" relation="include"> </childnode> <childnode refid="32" relation="include"> </childnode> </node> <node id="55"> <label>lib/kmalloc.h</label> <link refid="kmalloc_8h"/> <childnode refid="3" relation="include"> </childnode> </node> <node id="51"> <label>net/mem.h</label> <link refid="mem_8h"/> <childnode refid="36" relation="include"> </childnode> </node> <node id="50"> <label>net/stats.h</label> <link refid="stats_8h"/> <childnode refid="36" relation="include"> </childnode> <childnode refid="51" relation="include"> </childnode> <childnode refid="52" relation="include"> </childnode> </node> <node id="32"> <label>vfs/vfs.h</label> <link refid="include_2vfs_2vfs_8h"/> <childnode refid="3" relation="include"> </childnode> <childnode refid="11" relation="include"> </childnode> <childnode refid="24" relation="include"> </childnode> <childnode refid="33" relation="include"> </childnode> <childnode refid="13" relation="include"> </childnode> <childnode refid="34" relation="include"> </childnode> <childnode refid="19" relation="include"> </childnode> </node> <node id="37"> <label>net/lwipopts.h</label> <link refid="lwipopts_8h"/> </node> <node id="24"> <label>vfs/mount.h</label> <link refid="mount_8h"/> <childnode refid="3" relation="include"> </childnode> </node> <node id="17"> <label>sys/resource.h</label> <link refid="resource_8h"/> <childnode refid="4" relation="include"> </childnode> </node> <node id="14"> <label>sys/trap.h</label> <link refid="trap_8h"/> <childnode refid="15" relation="include"> </childnode> </node> <node id="3"> <label>sys/types.h</label> <link refid="include_2sys_2types_8h"/> <childnode refid="4" relation="include"> </childnode> <childnode refid="5" relation="include"> </childnode> </node> <node id="11"> <label>vfs/file.h</label> <link refid="include_2vfs_2file_8h"/> <childnode refid="3" relation="include"> </childnode> <childnode refid="12" relation="include"> </childnode> <childnode refid="13" relation="include"> </childnode> <childnode refid="18" relation="include"> </childnode> <childnode refid="24" relation="include"> </childnode> <childnode refid="22" relation="include"> </childnode> </node> <node id="29"> <label>ubixos/exec.h</label> <link refid="exec_8h"/> <childnode refid="3" relation="include"> </childnode> <childnode refid="10" relation="include"> </childnode> </node> <node id="46"> <label>net/def.h</label> <link refid="def_8h"/> <childnode refid="39" relation="include"> </childnode> <childnode refid="36" relation="include"> </childnode> </node> <node id="35"> <label>net/netif.h</label> <link refid="netif_8h"/> <childnode refid="36" relation="include"> </childnode> <childnode refid="44" relation="include"> </childnode> <childnode refid="45" relation="include"> </childnode> <childnode refid="46" relation="include"> </childnode> <childnode refid="49" relation="include"> </childnode> <childnode refid="50" relation="include"> </childnode> </node> <node id="39"> <label>net/arch.h</label> <link refid="arch_8h"/> <childnode refid="3" relation="include"> </childnode> <childnode refid="40" relation="include"> </childnode> <childnode refid="41" relation="include"> </childnode> <childnode refid="43" relation="include"> </childnode> </node> <node id="21"> <label>fs/msdos_fs.h</label> <link refid="msdos__fs_8h"/> </node> <node id="16"> <label>sys/signal.h</label> <link refid="sys_2signal_8h"/> <childnode refid="3" relation="include"> </childnode> </node> <node id="20"> <label>fs/pipe_fs.h</label> <link refid="pipe__fs_8h"/> </node> <node id="19"> <label>ubixos/wait.h</label> <link refid="wait_8h"/> </node> <node id="48"> <label>net/ip6_addr.h</label> <link refid="ip6__addr_8h"/> <childnode refid="36" relation="include"> </childnode> <childnode refid="46" relation="include"> </childnode> </node> <node id="36"> <label>net/opt.h</label> <link refid="opt_8h"/> <childnode refid="37" relation="include"> </childnode> <childnode refid="38" relation="include"> </childnode> </node> <node id="41"> <label>lib/kprintf.h</label> <link refid="kprintf_8h"/> <childnode refid="3" relation="include"> </childnode> <childnode refid="42" relation="include"> </childnode> </node> <node id="38"> <label>net/debug.h</label> <link refid="debug_8h"/> <childnode refid="39" relation="include"> </childnode> <childnode refid="36" relation="include"> </childnode> </node> <node id="47"> <label>net/ip4_addr.h</label> <link refid="ip4__addr_8h"/> <childnode refid="36" relation="include"> </childnode> <childnode refid="46" relation="include"> </childnode> </node> <node id="45"> <label>net/ip_addr.h</label> <link refid="ip__addr_8h"/> <childnode refid="36" relation="include"> </childnode> <childnode refid="46" relation="include"> </childnode> <childnode refid="47" relation="include"> </childnode> <childnode refid="48" relation="include"> </childnode> </node> <node id="13"> <label>sys/thread.h</label> <link refid="thread_8h"/> <childnode refid="3" relation="include"> </childnode> <childnode refid="14" relation="include"> </childnode> <childnode refid="16" relation="include"> </childnode> <childnode refid="17" relation="include"> </childnode> </node> <node id="53"> <label>net/priv/memp_std.h</label> <link refid="memp__std_8h"/> </node> <node id="6"> <label>sys/cdefs.h</label> <link refid="cdefs_8h"/> </node> <node id="27"> <label>ubixos/time.h</label> <link refid="time_8h"/> <childnode refid="3" relation="include"> </childnode> <childnode refid="7" relation="include"> </childnode> <childnode refid="28" relation="include"> </childnode> </node> <node id="10"> <label>ubixos/sched.h</label> <link refid="sched_8h"/> <childnode refid="3" relation="include"> </childnode> <childnode refid="11" relation="include"> </childnode> <childnode refid="25" relation="include"> </childnode> <childnode refid="26" relation="include"> </childnode> <childnode refid="13" relation="include"> </childnode> </node> <node id="4"> <label>sys/_types.h</label> <link refid="__types_8h"/> </node> <node id="44"> <label>net/err.h</label> <link refid="err_8h"/> <childnode refid="36" relation="include"> </childnode> <childnode refid="39" relation="include"> </childnode> </node> <node id="7"> <label>sys/_timespec.h</label> <link refid="__timespec_8h"/> <childnode refid="4" relation="include"> </childnode> </node> <node id="23"> <label>sys/device.h</label> <link refid="include_2sys_2device_8h"/> <childnode refid="3" relation="include"> </childnode> </node> <node id="33"> <label>sys/sysproto_posix.h</label> <link refid="sysproto__posix_8h"/> <childnode refid="16" relation="include"> </childnode> <childnode refid="13" relation="include"> </childnode> <childnode refid="11" relation="include"> </childnode> </node> <node id="12"> <label>ubixfs/dirCache.h</label> <link refid="dirCache_8h"/> <childnode refid="3" relation="include"> </childnode> </node> <node id="8"> <label>sys/_timeval.h</label> <link refid="__timeval_8h"/> <childnode refid="4" relation="include"> </childnode> </node> <node id="1"> <label>C:/Dev/git/UbixOS/sys/kernel/ubthread.c</label> <link refid="ubthread_8c"/> <childnode refid="2" relation="include"> </childnode> <childnode refid="29" relation="include"> </childnode> <childnode refid="10" relation="include"> </childnode> <childnode refid="27" relation="include"> </childnode> <childnode refid="30" relation="include"> </childnode> <childnode refid="31" relation="include"> </childnode> <childnode refid="55" relation="include"> </childnode> <childnode refid="41" relation="include"> </childnode> <childnode refid="43" relation="include"> </childnode> <childnode refid="56" relation="include"> </childnode> </node> <node id="52"> <label>net/memp.h</label> <link refid="memp_8h"/> <childnode refid="36" relation="include"> </childnode> <childnode refid="53" relation="include"> </childnode> <childnode refid="54" relation="include"> </childnode> <childnode refid="50" relation="include"> </childnode> </node> </incdepgraph> <sectiondef kind="var"> <memberdef kind="variable" id="ubthread_8c_1ac90cec8b766ba40fe62cf0d6328da970" prot="public" static="no" mutable="no"> <type>struct <ref refid="structubthread__cond__list" kindref="compound">ubthread_cond_list</ref> *</type> <definition>struct ubthread_cond_list* conds</definition> <argsstring></argsstring> <name>conds</name> <initializer>= 0x0</initializer> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" line="42" column="25" bodyfile="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" bodystart="42" bodyend="-1"/> </memberdef> <memberdef kind="variable" id="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" prot="public" static="no" mutable="no"> <type>struct <ref refid="structubthread__mutex__list" kindref="compound">ubthread_mutex_list</ref> *</type> <definition>struct ubthread_mutex_list* mutex</definition> <argsstring></argsstring> <name>mutex</name> <initializer>= 0x0</initializer> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" line="43" column="26" bodyfile="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" bodystart="43" bodyend="-1"/> <referencedby refid="group__sys__mutex_1ga16336ce68b741e98204102ca4bc84dd9" compoundref="sys__arch_8c" startline="149" endline="151">sys_mutex_free</referencedby> <referencedby refid="group__sys__mutex_1ga4d4eb9afe5965fa2661dd54ff55d616a" compoundref="sys__arch_8c" startline="153" endline="155">sys_mutex_lock</referencedby> <referencedby refid="group__sys__mutex_1ga38e7dae1fd88b338eb1cd97f110f3897" compoundref="sys__arch_8c" startline="144" endline="147">sys_mutex_new</referencedby> <referencedby refid="group__sys__mutex_1ga5568f68898fe9d5735f9ce2f665624fb" compoundref="sys__arch_8c" startline="157" endline="159">sys_mutex_unlock</referencedby> <referencedby refid="ubthread_8c_1a996be9a927447a62f7168a082a046c54" compoundref="ubthread_8c" startline="129" endline="146">ubthread_cond_timedwait</referencedby> <referencedby refid="ubthread_8c_1a30eb7c156c2422801ddb86326dbc3d81" compoundref="ubthread_8c" startline="148" endline="155">ubthread_cond_wait</referencedby> <referencedby refid="ubthread_8c_1a278f5d5b1e11b6668b75da6a285442e4" compoundref="ubthread_8c" startline="77" endline="81">ubthread_mutex_destroy</referencedby> <referencedby refid="ubthread_8c_1a32f60f4953d8865991ea48cf26236b97" compoundref="ubthread_8c" startline="60" endline="69">ubthread_mutex_init</referencedby> <referencedby refid="ubthread_8c_1aa13bf141cd3e9bf0921fbf61ffc637d8" compoundref="ubthread_8c" startline="88" endline="107">ubthread_mutex_lock</referencedby> <referencedby refid="ubthread_8c_1afea3530bab360f59c09a49f490d079dd" compoundref="ubthread_8c" startline="109" endline="127">ubthread_mutex_unlock</referencedby> </memberdef> </sectiondef> <sectiondef kind="func"> <memberdef kind="function" id="ubthread_8c_1aeb2f756a095ecfddad31354f819623ee" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> <type>int</type> <definition>int ubthread_cond_broadcast</definition> <argsstring>(ubthread_cond_t *cond)</argsstring> <name>ubthread_cond_broadcast</name> <param> <type><ref refid="ubthread_8h_1a96521d8547d8b54e20e6f18d83c06901" kindref="member">ubthread_cond_t</ref> *</type> <declname>cond</declname> </param> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" line="164" column="5" bodyfile="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" bodystart="164" bodyend="169"/> <referencedby refid="group__sys__sem_1gaff1dd2af219b75ae812e0b1660bd7455" compoundref="sys__arch_8c" startline="89" endline="103">sys_sem_signal</referencedby> </memberdef> <memberdef kind="function" id="ubthread_8c_1ae914fae69538736dc5e494c15ce93a17" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> <type>int</type> <definition>int ubthread_cond_destroy</definition> <argsstring>(ubthread_cond_t *cond)</argsstring> <name>ubthread_cond_destroy</name> <param> <type><ref refid="ubthread_8h_1a96521d8547d8b54e20e6f18d83c06901" kindref="member">ubthread_cond_t</ref> *</type> <declname>cond</declname> </param> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" line="71" column="5" bodyfile="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" bodystart="71" bodyend="75"/> <references refid="kmalloc_8h_1aaa9ed6886459604cf73ccdbf6410e487" compoundref="kmalloc_8c" startline="342" endline="382">kfree</references> <referencedby refid="sem_8c_1aa386df202c6e9b90a1445a61ce694210" compoundref="sem_8c" startline="87" endline="100">sem_destroy</referencedby> </memberdef> <memberdef kind="function" id="ubthread_8c_1a57168ab258d780168b7334a387651133" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> <type>int</type> <definition>int ubthread_cond_init</definition> <argsstring>(ubthread_cond_t *cond, const uint32_t attr)</argsstring> <name>ubthread_cond_init</name> <param> <type><ref refid="ubthread_8h_1a96521d8547d8b54e20e6f18d83c06901" kindref="member">ubthread_cond_t</ref> *</type> <declname>cond</declname> </param> <param> <type><ref refid="cdefs_8h_1a2c212835823e3c54a8ab6d95c652660e" kindref="member">const</ref> <ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref></type> <declname>attr</declname> </param> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" line="49" column="5" bodyfile="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" bodystart="49" bodyend="58"/> <references refid="stdatomic_8h_1ad501bafcd2074b392f630497545de87d" compoundref="stdatomic_8h" startline="89">ATOMIC_VAR_INIT</references> <references refid="structubthread__cond_1a9557e920c79c936de8ce6b9f9a65a245" compoundref="ubthread_8h" startline="48">ubthread_cond::id</references> <references refid="kmalloc_8h_1a150eab2ac4ce4553e21ca10e7f441762" compoundref="kmalloc_8c" startline="241" endline="331">kmalloc</references> <references refid="structubthread__cond_1aae369fe44ca2aee0e9e0df01a5dda323" compoundref="ubthread_8h" startline="49">ubthread_cond::lock</references> <references refid="string_8h_1ace4b911463887af5e748326323e99a23">memset</references> </memberdef> <memberdef kind="function" id="ubthread_8c_1a64fb8f5f2da2564a6cae8c9f2c3bde10" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> <type>int</type> <definition>int ubthread_cond_signal</definition> <argsstring>(ubthread_cond_t *cond)</argsstring> <name>ubthread_cond_signal</name> <param> <type><ref refid="ubthread_8h_1a96521d8547d8b54e20e6f18d83c06901" kindref="member">ubthread_cond_t</ref> *</type> <declname>cond</declname> </param> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" line="157" column="5" bodyfile="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" bodystart="157" bodyend="162"/> </memberdef> <memberdef kind="function" id="ubthread_8c_1a996be9a927447a62f7168a082a046c54" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> <type>int</type> <definition>int ubthread_cond_timedwait</definition> <argsstring>(ubthread_cond_t *cond, ubthread_mutex_t *mutex, const struct timespec *abstime)</argsstring> <name>ubthread_cond_timedwait</name> <param> <type><ref refid="ubthread_8h_1a96521d8547d8b54e20e6f18d83c06901" kindref="member">ubthread_cond_t</ref> *</type> <declname>cond</declname> </param> <param> <type><ref refid="ubthread_8h_1a2b33c44e0ad37a62d92aaeeb011860e0" kindref="member">ubthread_mutex_t</ref> *</type> <declname>mutex</declname> </param> <param> <type><ref refid="cdefs_8h_1a2c212835823e3c54a8ab6d95c652660e" kindref="member">const</ref> struct <ref refid="structtimespec" kindref="compound">timespec</ref> *</type> <declname>abstime</declname> </param> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" line="129" column="5" bodyfile="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" bodystart="129" bodyend="146"/> <references refid="include_2sys_2types_8h_1af6a258d8f3ee5206d682d799316314b1aa1e095cc966dbecf6a0d8aad75348d1a" compoundref="include_2sys_2types_8h" startline="82">FALSE</references> <references refid="structubthread__cond_1aae369fe44ca2aee0e9e0df01a5dda323" compoundref="ubthread_8h" startline="49">ubthread_cond::lock</references> <references refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" compoundref="ubthread_8c" startline="43">mutex</references> <references refid="armv6_2sched_8c_1a08933fe6d593a1c78b9080359f15a0b7" compoundref="armv6_2sched_8c" startline="244" endline="246">sched_yield</references> <references refid="vitals_8h_1a67aae71be472453526fc1a0bfbf80280" compoundref="vitals_8c" startline="35">systemVitals</references> <references refid="structvitalsStruct_1a78832d978f9753eb94bf615dc215f511" compoundref="vitals_8h" startline="38">vitalsStruct::sysUptime</references> <references refid="ubthread_8c_1aa13bf141cd3e9bf0921fbf61ffc637d8" compoundref="ubthread_8c" startline="88" endline="107">ubthread_mutex_lock</references> <references refid="ubthread_8c_1afea3530bab360f59c09a49f490d079dd" compoundref="ubthread_8c" startline="109" endline="127">ubthread_mutex_unlock</references> </memberdef> <memberdef kind="function" id="ubthread_8c_1a30eb7c156c2422801ddb86326dbc3d81" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> <type>int</type> <definition>int ubthread_cond_wait</definition> <argsstring>(ubthread_cond_t *cond, ubthread_mutex_t *mutex)</argsstring> <name>ubthread_cond_wait</name> <param> <type><ref refid="ubthread_8h_1a96521d8547d8b54e20e6f18d83c06901" kindref="member">ubthread_cond_t</ref> *</type> <declname>cond</declname> </param> <param> <type><ref refid="ubthread_8h_1a2b33c44e0ad37a62d92aaeeb011860e0" kindref="member">ubthread_mutex_t</ref> *</type> <declname>mutex</declname> </param> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" line="148" column="5" bodyfile="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" bodystart="148" bodyend="155"/> <references refid="structubthread__cond_1aae369fe44ca2aee0e9e0df01a5dda323" compoundref="ubthread_8h" startline="49">ubthread_cond::lock</references> <references refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" compoundref="ubthread_8c" startline="43">mutex</references> <references refid="armv6_2sched_8c_1a08933fe6d593a1c78b9080359f15a0b7" compoundref="armv6_2sched_8c" startline="244" endline="246">sched_yield</references> <references refid="include_2sys_2types_8h_1af6a258d8f3ee5206d682d799316314b1aa82764c3079aea4e60c80e45befbb839" compoundref="include_2sys_2types_8h" startline="82">TRUE</references> <references refid="ubthread_8c_1aa13bf141cd3e9bf0921fbf61ffc637d8" compoundref="ubthread_8c" startline="88" endline="107">ubthread_mutex_lock</references> <references refid="ubthread_8c_1afea3530bab360f59c09a49f490d079dd" compoundref="ubthread_8c" startline="109" endline="127">ubthread_mutex_unlock</references> </memberdef> <memberdef kind="function" id="ubthread_8c_1aa0af177ef44888f3c93883294207328e" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> <type>int</type> <definition>int ubthread_create</definition> <argsstring>(kTask_t **thread, const uInt32 *attr, void(*tproc)(void), void *arg)</argsstring> <name>ubthread_create</name> <param> <type><ref refid="sched_8h_1a4096d94f76d96bbf005b9bbd45ed4ae1" kindref="member">kTask_t</ref> **</type> <declname>thread</declname> </param> <param> <type><ref refid="cdefs_8h_1a2c212835823e3c54a8ab6d95c652660e" kindref="member">const</ref> <ref refid="objgfx30_8h_1ada085051a6d9a8e00a2cb256d1af14ba" kindref="member">uInt32</ref> *</type> <declname>attr</declname> </param> <param> <type>void(*)(void)</type> <declname>tproc</declname> </param> <param> <type>void *</type> <declname>arg</declname> </param> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" line="83" column="5" bodyfile="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" bodystart="83" bodyend="86"/> <references refid="exec_8c_1a4b86d28d8fd56197042aef174de2fd58" compoundref="exec_8c" startline="66" endline="136">execThread</references> </memberdef> <memberdef kind="function" id="ubthread_8c_1a278f5d5b1e11b6668b75da6a285442e4" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> <type>int</type> <definition>int ubthread_mutex_destroy</definition> <argsstring>(ubthread_mutex_t *mutex)</argsstring> <name>ubthread_mutex_destroy</name> <param> <type><ref refid="ubthread_8h_1a2b33c44e0ad37a62d92aaeeb011860e0" kindref="member">ubthread_mutex_t</ref> *</type> <declname>mutex</declname> </param> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" line="77" column="5" bodyfile="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" bodystart="77" bodyend="81"/> <references refid="kmalloc_8h_1aaa9ed6886459604cf73ccdbf6410e487" compoundref="kmalloc_8c" startline="342" endline="382">kfree</references> <references refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" compoundref="ubthread_8c" startline="43">mutex</references> <referencedby refid="sem_8c_1aa386df202c6e9b90a1445a61ce694210" compoundref="sem_8c" startline="87" endline="100">sem_destroy</referencedby> <referencedby refid="group__sys__mutex_1ga16336ce68b741e98204102ca4bc84dd9" compoundref="sys__arch_8c" startline="149" endline="151">sys_mutex_free</referencedby> </memberdef> <memberdef kind="function" id="ubthread_8c_1a32f60f4953d8865991ea48cf26236b97" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> <type>int</type> <definition>int ubthread_mutex_init</definition> <argsstring>(ubthread_mutex_t *mutex, const uint32_t attr)</argsstring> <name>ubthread_mutex_init</name> <param> <type><ref refid="ubthread_8h_1a2b33c44e0ad37a62d92aaeeb011860e0" kindref="member">ubthread_mutex_t</ref> *</type> <declname>mutex</declname> </param> <param> <type><ref refid="cdefs_8h_1a2c212835823e3c54a8ab6d95c652660e" kindref="member">const</ref> <ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref></type> <declname>attr</declname> </param> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" line="60" column="5" bodyfile="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" bodystart="60" bodyend="69"/> <references refid="stdatomic_8h_1ad501bafcd2074b392f630497545de87d" compoundref="stdatomic_8h" startline="89">ATOMIC_VAR_INIT</references> <references refid="structubthread__mutex_1a57e2eddcab2e03f27fe5b75c7840b619" compoundref="ubthread_8h" startline="53">ubthread_mutex::id</references> <references refid="kmalloc_8h_1a150eab2ac4ce4553e21ca10e7f441762" compoundref="kmalloc_8c" startline="241" endline="331">kmalloc</references> <references refid="structubthread__mutex_1aac3657ca9969799cdcbc0e9e66926be2" compoundref="ubthread_8h" startline="54">ubthread_mutex::lock</references> <references refid="string_8h_1ace4b911463887af5e748326323e99a23">memset</references> <references refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" compoundref="ubthread_8c" startline="43">mutex</references> </memberdef> <memberdef kind="function" id="ubthread_8c_1aa13bf141cd3e9bf0921fbf61ffc637d8" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> <type>int</type> <definition>int ubthread_mutex_lock</definition> <argsstring>(ubthread_mutex_t *mutex)</argsstring> <name>ubthread_mutex_lock</name> <param> <type><ref refid="ubthread_8h_1a2b33c44e0ad37a62d92aaeeb011860e0" kindref="member">ubthread_mutex_t</ref> *</type> <declname>mutex</declname> </param> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" line="88" column="5" bodyfile="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" bodystart="88" bodyend="107"/> <references refid="armv6_2sched_8c_1a54397bfe18d5da4d50ff03b15f540858" compoundref="armv6_2sched_8c" startline="50">_current</references> <references refid="structtaskStruct_1a30966587a60db6b40c8be6c387e11d81" compoundref="sched_8h" startline="63">taskStruct::id</references> <references refid="armv6_2kpanic_8c_1adb9a182aa071791a306163d50d653deb" compoundref="armv6_2kpanic_8c" startline="41" endline="61">kpanic</references> <references refid="kprintf_8h_1a20b56810edb62a6fe59917015c30848f" compoundref="kprintf_8c" startline="259" endline="276">kprintf</references> <references refid="structubthread__mutex_1aac3657ca9969799cdcbc0e9e66926be2" compoundref="ubthread_8h" startline="54">ubthread_mutex::lock</references> <references refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" compoundref="ubthread_8c" startline="43">mutex</references> <references refid="structubthread__mutex_1a9c8643e4d9bec2a38ea1d45e82609f2a" compoundref="ubthread_8h" startline="55">ubthread_mutex::pid</references> <references refid="include_2sys_2types_8h_1af6a258d8f3ee5206d682d799316314b1aa82764c3079aea4e60c80e45befbb839" compoundref="include_2sys_2types_8h" startline="82">TRUE</references> <referencedby refid="group__sys__sem_1ga28aa725e8a36dd0cfde89875af4f3ec9" compoundref="sys__arch_8c" startline="105" endline="130">sys_arch_sem_wait</referencedby> <referencedby refid="group__sys__mutex_1ga4d4eb9afe5965fa2661dd54ff55d616a" compoundref="sys__arch_8c" startline="153" endline="155">sys_mutex_lock</referencedby> <referencedby refid="group__sys__sem_1gaff1dd2af219b75ae812e0b1660bd7455" compoundref="sys__arch_8c" startline="89" endline="103">sys_sem_signal</referencedby> <referencedby refid="ubthread_8c_1a996be9a927447a62f7168a082a046c54" compoundref="ubthread_8c" startline="129" endline="146">ubthread_cond_timedwait</referencedby> <referencedby refid="ubthread_8c_1a30eb7c156c2422801ddb86326dbc3d81" compoundref="ubthread_8c" startline="148" endline="155">ubthread_cond_wait</referencedby> </memberdef> <memberdef kind="function" id="ubthread_8c_1afea3530bab360f59c09a49f490d079dd" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> <type>int</type> <definition>int ubthread_mutex_unlock</definition> <argsstring>(ubthread_mutex_t *mutex)</argsstring> <name>ubthread_mutex_unlock</name> <param> <type><ref refid="ubthread_8h_1a2b33c44e0ad37a62d92aaeeb011860e0" kindref="member">ubthread_mutex_t</ref> *</type> <declname>mutex</declname> </param> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" line="109" column="5" bodyfile="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" bodystart="109" bodyend="127"/> <references refid="armv6_2sched_8c_1a54397bfe18d5da4d50ff03b15f540858" compoundref="armv6_2sched_8c" startline="50">_current</references> <references refid="structtaskStruct_1a30966587a60db6b40c8be6c387e11d81" compoundref="sched_8h" startline="63">taskStruct::id</references> <references refid="armv6_2kpanic_8c_1adb9a182aa071791a306163d50d653deb" compoundref="armv6_2kpanic_8c" startline="41" endline="61">kpanic</references> <references refid="kprintf_8h_1a20b56810edb62a6fe59917015c30848f" compoundref="kprintf_8c" startline="259" endline="276">kprintf</references> <references refid="structubthread__mutex_1aac3657ca9969799cdcbc0e9e66926be2" compoundref="ubthread_8h" startline="54">ubthread_mutex::lock</references> <references refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" compoundref="ubthread_8c" startline="43">mutex</references> <references refid="structubthread__mutex_1a9c8643e4d9bec2a38ea1d45e82609f2a" compoundref="ubthread_8h" startline="55">ubthread_mutex::pid</references> <references refid="include_2sys_2types_8h_1af6a258d8f3ee5206d682d799316314b1aa82764c3079aea4e60c80e45befbb839" compoundref="include_2sys_2types_8h" startline="82">TRUE</references> <referencedby refid="group__sys__mutex_1ga5568f68898fe9d5735f9ce2f665624fb" compoundref="sys__arch_8c" startline="157" endline="159">sys_mutex_unlock</referencedby> <referencedby refid="group__sys__sem_1gaff1dd2af219b75ae812e0b1660bd7455" compoundref="sys__arch_8c" startline="89" endline="103">sys_sem_signal</referencedby> <referencedby refid="ubthread_8c_1a996be9a927447a62f7168a082a046c54" compoundref="ubthread_8c" startline="129" endline="146">ubthread_cond_timedwait</referencedby> <referencedby refid="ubthread_8c_1a30eb7c156c2422801ddb86326dbc3d81" compoundref="ubthread_8c" startline="148" endline="155">ubthread_cond_wait</referencedby> </memberdef> <memberdef kind="function" id="ubthread_8c_1a72a362bc8127b8d63e1107062638664d" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual"> <type><ref refid="sched_8h_1a4096d94f76d96bbf005b9bbd45ed4ae1" kindref="member">kTask_t</ref> *</type> <definition>kTask_t* ubthread_self</definition> <argsstring>()</argsstring> <name>ubthread_self</name> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <inbodydescription> </inbodydescription> <location file="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" line="45" column="9" bodyfile="C:/Dev/git/UbixOS/sys/kernel/ubthread.c" bodystart="45" bodyend="47"/> <references refid="armv6_2sched_8c_1a54397bfe18d5da4d50ff03b15f540858" compoundref="armv6_2sched_8c" startline="50">_current</references> </memberdef> </sectiondef> <briefdescription> </briefdescription> <detaileddescription> </detaileddescription> <programlisting> <codeline lineno="1"><highlight class="comment">/*-</highlight></codeline> <codeline lineno="2"><highlight class="comment"><sp/>*<sp/>Copyright<sp/>(c)<sp/>2002-2018<sp/>The<sp/>UbixOS<sp/>Project.</highlight></codeline> <codeline lineno="3"><highlight class="comment"><sp/>*<sp/>All<sp/>rights<sp/>reserved.</highlight></codeline> <codeline lineno="4"><highlight class="comment"><sp/>*</highlight></codeline> <codeline lineno="5"><highlight class="comment"><sp/>*<sp/>This<sp/>was<sp/>developed<sp/>by<sp/>Christopher<sp/>W.<sp/>Olsen<sp/>for<sp/>the<sp/>UbixOS<sp/>Project.</highlight></codeline> <codeline lineno="6"><highlight class="comment"><sp/>*</highlight></codeline> <codeline lineno="7"><highlight class="comment"><sp/>*<sp/>Redistribution<sp/>and<sp/>use<sp/>in<sp/>source<sp/>and<sp/>binary<sp/>forms,<sp/>with<sp/>or<sp/>without<sp/>modification,<sp/>are<sp/>permitted</highlight></codeline> <codeline lineno="8"><highlight class="comment"><sp/>*<sp/>provided<sp/>that<sp/>the<sp/>following<sp/>conditions<sp/>are<sp/>met:</highlight></codeline> <codeline lineno="9"><highlight class="comment"><sp/>*</highlight></codeline> <codeline lineno="10"><highlight class="comment"><sp/>*<sp/>1)<sp/>Redistributions<sp/>of<sp/>source<sp/>code<sp/>must<sp/>retain<sp/>the<sp/>above<sp/>copyright<sp/>notice,<sp/>this<sp/>list<sp/>of</highlight></codeline> <codeline lineno="11"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>conditions,<sp/>the<sp/>following<sp/>disclaimer<sp/>and<sp/>the<sp/>list<sp/>of<sp/>authors.</highlight></codeline> <codeline lineno="12"><highlight class="comment"><sp/>*<sp/>2)<sp/>Redistributions<sp/>in<sp/>binary<sp/>form<sp/>must<sp/>reproduce<sp/>the<sp/>above<sp/>copyright<sp/>notice,<sp/>this<sp/>list<sp/>of</highlight></codeline> <codeline lineno="13"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>conditions,<sp/>the<sp/>following<sp/>disclaimer<sp/>and<sp/>the<sp/>list<sp/>of<sp/>authors<sp/>in<sp/>the<sp/>documentation<sp/>and/or</highlight></codeline> <codeline lineno="14"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>other<sp/>materials<sp/>provided<sp/>with<sp/>the<sp/>distribution.</highlight></codeline> <codeline lineno="15"><highlight class="comment"><sp/>*<sp/>3)<sp/>Neither<sp/>the<sp/>name<sp/>of<sp/>the<sp/>UbixOS<sp/>Project<sp/>nor<sp/>the<sp/>names<sp/>of<sp/>its<sp/>contributors<sp/>may<sp/>be<sp/>used<sp/>to</highlight></codeline> <codeline lineno="16"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>endorse<sp/>or<sp/>promote<sp/>products<sp/>derived<sp/>from<sp/>this<sp/>software<sp/>without<sp/>specific<sp/>prior<sp/>written</highlight></codeline> <codeline lineno="17"><highlight class="comment"><sp/>*<sp/><sp/><sp/><sp/>permission.</highlight></codeline> <codeline lineno="18"><highlight class="comment"><sp/>*</highlight></codeline> <codeline lineno="19"><highlight class="comment"><sp/>*<sp/>THIS<sp/>SOFTWARE<sp/>IS<sp/>PROVIDED<sp/>BY<sp/>THE<sp/>AUTHOR<sp/>AND<sp/>CONTRIBUTORS<sp/>"AS<sp/>IS"<sp/>AND<sp/>ANY<sp/>EXPRESS<sp/>OR<sp/>IMPLIED</highlight></codeline> <codeline lineno="20"><highlight class="comment"><sp/>*<sp/>WARRANTIES,<sp/>INCLUDING,<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO,<sp/>THE<sp/>IMPLIED<sp/>WARRANTIES<sp/>OF<sp/>MERCHANTABILITY<sp/>AND<sp/>FITNESS</highlight></codeline> <codeline lineno="21"><highlight class="comment"><sp/>*<sp/>FOR<sp/>A<sp/>PARTICULAR<sp/>PURPOSE<sp/>ARE<sp/>DISCLAIMED.<sp/>IN<sp/>NO<sp/>EVENT<sp/>SHALL<sp/>THE<sp/>COPYRIGHT<sp/>OWNER<sp/>OR<sp/>CONTRIBUTORS</highlight></codeline> <codeline lineno="22"><highlight class="comment"><sp/>*<sp/>BE<sp/>LIABLE<sp/>FOR<sp/>ANY<sp/>DIRECT,<sp/>INDIRECT,<sp/>INCIDENTAL,<sp/>SPECIAL,<sp/>EXEMPLARY,<sp/>OR<sp/>CONSEQUENTIAL<sp/>DAMAGES</highlight></codeline> <codeline lineno="23"><highlight class="comment"><sp/>*<sp/>(INCLUDING,<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO,<sp/>PROCUREMENT<sp/>OF<sp/>SUBSTITUTE<sp/>GOODS<sp/>OR<sp/>SERVICES;<sp/>LOSS<sp/>OF<sp/>USE,<sp/>DATA,</highlight></codeline> <codeline lineno="24"><highlight class="comment"><sp/>*<sp/>OR<sp/>PROFITS;<sp/>OR<sp/>BUSINESS<sp/>INTERRUPTION)<sp/>HOWEVER<sp/>CAUSED<sp/>AND<sp/>ON<sp/>ANY<sp/>THEORY<sp/>OF<sp/>LIABILITY,<sp/>WHETHER<sp/>IN</highlight></codeline> <codeline lineno="25"><highlight class="comment"><sp/>*<sp/>CONTRACT,<sp/>STRICT<sp/>LIABILITY,<sp/>OR<sp/>TORT<sp/>(INCLUDING<sp/>NEGLIGENCE<sp/>OR<sp/>OTHERWISE)<sp/>ARISING<sp/>IN<sp/>ANY<sp/>WAY<sp/>OUT</highlight></codeline> <codeline lineno="26"><highlight class="comment"><sp/>*<sp/>OF<sp/>THE<sp/>USE<sp/>OF<sp/>THIS<sp/>SOFTWARE,<sp/>EVEN<sp/>IF<sp/>ADVISED<sp/>OF<sp/>THE<sp/>POSSIBILITY<sp/>OF<sp/>SUCH<sp/>DAMAGE.</highlight></codeline> <codeline lineno="27"><highlight class="comment"><sp/>*/</highlight><highlight class="normal"></highlight></codeline> <codeline lineno="28"><highlight class="normal"></highlight></codeline> <codeline lineno="29"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>All<sp/>these<sp/>must<sp/>be<sp/>converted<sp/>to<sp/>be<sp/>done<sp/>atomically<sp/>*/</highlight><highlight class="normal"></highlight></codeline> <codeline lineno="30"><highlight class="normal"></highlight></codeline> <codeline lineno="31"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="ubthread_8h" kindref="compound">ubixos/ubthread.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="32"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="exec_8h" kindref="compound">ubixos/exec.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="33"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="sched_8h" kindref="compound">ubixos/sched.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="34"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="time_8h" kindref="compound">ubixos/time.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="35"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="spinlock_8h" kindref="compound">ubixos/spinlock.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="36"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="vitals_8h" kindref="compound">ubixos/vitals.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="37"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="kmalloc_8h" kindref="compound">lib/kmalloc.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="38"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="kprintf_8h" kindref="compound">lib/kprintf.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="39"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="kpanic_8h" kindref="compound">ubixos/kpanic.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="40"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/><<ref refid="stdatomic_8h" kindref="compound">sys/stdatomic.h</ref>></highlight><highlight class="normal"></highlight></codeline> <codeline lineno="41"><highlight class="normal"></highlight></codeline> <codeline lineno="42" refid="ubthread_8c_1ac90cec8b766ba40fe62cf0d6328da970" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structubthread__cond__list" kindref="compound">ubthread_cond_list</ref><sp/>*<ref refid="ubthread_8c_1ac90cec8b766ba40fe62cf0d6328da970" kindref="member">conds</ref><sp/>=<sp/>0x0;</highlight></codeline> <codeline lineno="43" refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structubthread__mutex__list" kindref="compound">ubthread_mutex_list</ref><sp/>*<ref refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" kindref="member">mutex</ref><sp/>=<sp/>0x0;</highlight></codeline> <codeline lineno="44"><highlight class="normal"></highlight></codeline> <codeline lineno="45" refid="ubthread_8c_1a72a362bc8127b8d63e1107062638664d" refkind="member"><highlight class="normal"><ref refid="structtaskStruct" kindref="compound">kTask_t</ref><sp/>*<ref refid="ubthread_8c_1a72a362bc8127b8d63e1107062638664d" kindref="member">ubthread_self</ref>()<sp/>{</highlight></codeline> <codeline lineno="46"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(<ref refid="armv6_2sched_8c_1a54397bfe18d5da4d50ff03b15f540858" kindref="member">_current</ref>);</highlight></codeline> <codeline lineno="47"><highlight class="normal">}</highlight></codeline> <codeline lineno="48"><highlight class="normal"></highlight></codeline> <codeline lineno="49" refid="ubthread_8c_1a57168ab258d780168b7334a387651133" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ubthread_8c_1a57168ab258d780168b7334a387651133" kindref="member">ubthread_cond_init</ref>(<ref refid="structubthread__cond" kindref="compound">ubthread_cond_t</ref><sp/>*cond,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>attr)<sp/>{</highlight></codeline> <codeline lineno="50"><highlight class="normal"><sp/><sp/><ref refid="structubthread__cond" kindref="compound">ubthread_cond_t</ref><sp/>ubcond<sp/>=<sp/><ref refid="kmalloc_8h_1a150eab2ac4ce4553e21ca10e7f441762" kindref="member">kmalloc</ref>(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structubthread__cond" kindref="compound">ubthread_cond</ref>));</highlight></codeline> <codeline lineno="51"><highlight class="normal"><sp/><sp/><ref refid="string_8h_1ace4b911463887af5e748326323e99a23" kindref="member">memset</ref>(ubcond,<sp/>0x0,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structubthread__cond" kindref="compound">ubthread_cond</ref>));</highlight></codeline> <codeline lineno="52"><highlight class="normal"></highlight></codeline> <codeline lineno="53"><highlight class="normal"><sp/><sp/>ubcond-><ref refid="structubthread__cond_1a9557e920c79c936de8ce6b9f9a65a245" kindref="member">id</ref><sp/>=<sp/>(int)<sp/>cond;</highlight></codeline> <codeline lineno="54"><highlight class="normal"><sp/><sp/>ubcond-><ref refid="structubthread__cond_1aae369fe44ca2aee0e9e0df01a5dda323" kindref="member">lock</ref><sp/>=<sp/><ref refid="stdatomic_8h_1ad501bafcd2074b392f630497545de87d" kindref="member">ATOMIC_VAR_INIT</ref>(0);</highlight></codeline> <codeline lineno="55"><highlight class="normal"></highlight></codeline> <codeline lineno="56"><highlight class="normal"><sp/><sp/>*cond<sp/>=<sp/>ubcond;</highlight></codeline> <codeline lineno="57"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline> <codeline lineno="58"><highlight class="normal">}</highlight></codeline> <codeline lineno="59"><highlight class="normal"></highlight></codeline> <codeline lineno="60" refid="ubthread_8c_1a32f60f4953d8865991ea48cf26236b97" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ubthread_8c_1a32f60f4953d8865991ea48cf26236b97" kindref="member">ubthread_mutex_init</ref>(<ref refid="structubthread__mutex" kindref="compound">ubthread_mutex_t</ref><sp/>*<ref refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" kindref="member">mutex</ref>,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>attr)<sp/>{</highlight></codeline> <codeline lineno="61"><highlight class="normal"><sp/><sp/><ref refid="structubthread__mutex" kindref="compound">ubthread_mutex_t</ref><sp/>ubmutex<sp/>=<sp/><ref refid="kmalloc_8h_1a150eab2ac4ce4553e21ca10e7f441762" kindref="member">kmalloc</ref>(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structubthread__mutex" kindref="compound">ubthread_mutex</ref>));</highlight></codeline> <codeline lineno="62"><highlight class="normal"><sp/><sp/><ref refid="string_8h_1ace4b911463887af5e748326323e99a23" kindref="member">memset</ref>(ubmutex,<sp/>0x0,<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structubthread__mutex" kindref="compound">ubthread_mutex</ref>));</highlight></codeline> <codeline lineno="63"><highlight class="normal"></highlight></codeline> <codeline lineno="64"><highlight class="normal"><sp/><sp/>ubmutex-><ref refid="structubthread__mutex_1a57e2eddcab2e03f27fe5b75c7840b619" kindref="member">id</ref><sp/>=<sp/>(int)<sp/><ref refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" kindref="member">mutex</ref>;</highlight></codeline> <codeline lineno="65"><highlight class="normal"><sp/><sp/>ubmutex-><ref refid="structubthread__mutex_1aac3657ca9969799cdcbc0e9e66926be2" kindref="member">lock</ref><sp/>=<sp/><ref refid="stdatomic_8h_1ad501bafcd2074b392f630497545de87d" kindref="member">ATOMIC_VAR_INIT</ref>(0);</highlight></codeline> <codeline lineno="66"><highlight class="normal"></highlight></codeline> <codeline lineno="67"><highlight class="normal"><sp/><sp/>*<ref refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" kindref="member">mutex</ref><sp/>=<sp/>ubmutex;</highlight></codeline> <codeline lineno="68"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline> <codeline lineno="69"><highlight class="normal">}</highlight></codeline> <codeline lineno="70"><highlight class="normal"></highlight></codeline> <codeline lineno="71" refid="ubthread_8c_1ae914fae69538736dc5e494c15ce93a17" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ubthread_8c_1ae914fae69538736dc5e494c15ce93a17" kindref="member">ubthread_cond_destroy</ref>(<ref refid="structubthread__cond" kindref="compound">ubthread_cond_t</ref><sp/>*cond)<sp/>{</highlight></codeline> <codeline lineno="72"><highlight class="normal"><sp/><sp/><ref refid="kmalloc_8h_1aaa9ed6886459604cf73ccdbf6410e487" kindref="member">kfree</ref>(*cond);</highlight></codeline> <codeline lineno="73"><highlight class="normal"><sp/><sp/>*cond<sp/>=<sp/>0x0;</highlight></codeline> <codeline lineno="74"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline> <codeline lineno="75"><highlight class="normal">}</highlight></codeline> <codeline lineno="76"><highlight class="normal"></highlight></codeline> <codeline lineno="77" refid="ubthread_8c_1a278f5d5b1e11b6668b75da6a285442e4" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ubthread_8c_1a278f5d5b1e11b6668b75da6a285442e4" kindref="member">ubthread_mutex_destroy</ref>(<ref refid="structubthread__mutex" kindref="compound">ubthread_mutex_t</ref><sp/>*<ref refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" kindref="member">mutex</ref>)<sp/>{</highlight></codeline> <codeline lineno="78"><highlight class="normal"><sp/><sp/><ref refid="kmalloc_8h_1aaa9ed6886459604cf73ccdbf6410e487" kindref="member">kfree</ref>(*<ref refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" kindref="member">mutex</ref>);</highlight></codeline> <codeline lineno="79"><highlight class="normal"><sp/><sp/>*<ref refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" kindref="member">mutex</ref><sp/>=<sp/>0x0;</highlight></codeline> <codeline lineno="80"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline> <codeline lineno="81"><highlight class="normal">}</highlight></codeline> <codeline lineno="82"><highlight class="normal"></highlight></codeline> <codeline lineno="83" refid="ubthread_8c_1aa0af177ef44888f3c93883294207328e" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ubthread_8c_1aa0af177ef44888f3c93883294207328e" kindref="member">ubthread_create</ref>(<ref refid="structtaskStruct" kindref="compound">kTask_t</ref><sp/>**<ref refid="structthread" kindref="compound">thread</ref>,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/><ref refid="objgfx30_8h_1ada085051a6d9a8e00a2cb256d1af14ba" kindref="member">uInt32</ref><sp/>*attr,<sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>(*tproc)(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">),<sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*arg)<sp/>{</highlight></codeline> <codeline lineno="84"><highlight class="normal"><sp/><sp/>*<ref refid="structthread" kindref="compound">thread</ref><sp/>=<sp/>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*)<sp/><ref refid="exec_8c_1a4b86d28d8fd56197042aef174de2fd58" kindref="member">execThread</ref>(tproc,0x2000,<sp/>arg);</highlight></codeline> <codeline lineno="85"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline> <codeline lineno="86"><highlight class="normal">}</highlight></codeline> <codeline lineno="87"><highlight class="normal"></highlight></codeline> <codeline lineno="88" refid="ubthread_8c_1aa13bf141cd3e9bf0921fbf61ffc637d8" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ubthread_8c_1aa13bf141cd3e9bf0921fbf61ffc637d8" kindref="member">ubthread_mutex_lock</ref>(<ref refid="structubthread__mutex" kindref="compound">ubthread_mutex_t</ref><sp/>*<ref refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" kindref="member">mutex</ref>)<sp/>{</highlight></codeline> <codeline lineno="89"><highlight class="normal"><sp/><sp/><ref refid="structubthread__mutex" kindref="compound">ubthread_mutex_t</ref><sp/>ubmutex<sp/>=<sp/>*<ref refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" kindref="member">mutex</ref>;</highlight></codeline> <codeline lineno="90"><highlight class="normal"></highlight></codeline> <codeline lineno="91"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ubmutex-><ref refid="structubthread__mutex_1aac3657ca9969799cdcbc0e9e66926be2" kindref="member">lock</ref><sp/>==<sp/><ref refid="include_2sys_2types_8h_1af6a258d8f3ee5206d682d799316314b1aa82764c3079aea4e60c80e45befbb839" kindref="member">TRUE</ref><sp/>&&<sp/>ubmutex-><ref refid="structubthread__mutex_1a9c8643e4d9bec2a38ea1d45e82609f2a" kindref="member">pid</ref><sp/>==<sp/><ref refid="armv6_2sched_8c_1a54397bfe18d5da4d50ff03b15f540858" kindref="member">_current</ref>-><ref refid="structtaskStruct_1a30966587a60db6b40c8be6c387e11d81" kindref="member">id</ref>)<sp/>{</highlight></codeline> <codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kprintf_8h_1a20b56810edb62a6fe59917015c30848f" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">"Mutex<sp/>Already<sp/>Locked<sp/>By<sp/>This<sp/>Thread"</highlight><highlight class="normal">);</highlight></codeline> <codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="armv6_2kpanic_8c_1adb9a182aa071791a306163d50d653deb" kindref="member">kpanic</ref>(</highlight><highlight class="stringliteral">"WHY?"</highlight><highlight class="normal">);</highlight></codeline> <codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline> <codeline lineno="95"><highlight class="normal"><sp/><sp/>}</highlight></codeline> <codeline lineno="96"><highlight class="normal"></highlight></codeline> <codeline lineno="97"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(1)<sp/>{</highlight></codeline> <codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(xchg_32(&ubmutex-><ref refid="structubthread__mutex_1aac3657ca9969799cdcbc0e9e66926be2" kindref="member">lock</ref>,<sp/><ref refid="include_2sys_2types_8h_1af6a258d8f3ee5206d682d799316314b1aa82764c3079aea4e60c80e45befbb839" kindref="member">TRUE</ref>)<sp/>==<sp/><ref refid="include_2sys_2types_8h_1af6a258d8f3ee5206d682d799316314b1aa1e095cc966dbecf6a0d8aad75348d1a" kindref="member">FALSE</ref>)</highlight></codeline> <codeline lineno="99"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline> <codeline lineno="100"><highlight class="normal"></highlight></codeline> <codeline lineno="101"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(ubmutex-><ref refid="structubthread__mutex_1aac3657ca9969799cdcbc0e9e66926be2" kindref="member">lock</ref><sp/>==<sp/><ref refid="include_2sys_2types_8h_1af6a258d8f3ee5206d682d799316314b1aa82764c3079aea4e60c80e45befbb839" kindref="member">TRUE</ref>)</highlight></codeline> <codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="armv6_2sched_8c_1a08933fe6d593a1c78b9080359f15a0b7" kindref="member">sched_yield</ref>();</highlight></codeline> <codeline lineno="103"><highlight class="normal"><sp/><sp/>}</highlight></codeline> <codeline lineno="104"><highlight class="normal"></highlight></codeline> <codeline lineno="105"><highlight class="normal"><sp/><sp/>ubmutex-><ref refid="structubthread__mutex_1a9c8643e4d9bec2a38ea1d45e82609f2a" kindref="member">pid</ref><sp/>=<sp/><ref refid="armv6_2sched_8c_1a54397bfe18d5da4d50ff03b15f540858" kindref="member">_current</ref>-><ref refid="structtaskStruct_1a30966587a60db6b40c8be6c387e11d81" kindref="member">id</ref>;</highlight></codeline> <codeline lineno="106"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline> <codeline lineno="107"><highlight class="normal">}</highlight></codeline> <codeline lineno="108"><highlight class="normal"></highlight></codeline> <codeline lineno="109" refid="ubthread_8c_1afea3530bab360f59c09a49f490d079dd" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ubthread_8c_1afea3530bab360f59c09a49f490d079dd" kindref="member">ubthread_mutex_unlock</ref>(<ref refid="structubthread__mutex" kindref="compound">ubthread_mutex_t</ref><sp/>*<ref refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" kindref="member">mutex</ref>)<sp/>{</highlight></codeline> <codeline lineno="110"><highlight class="normal"><sp/><sp/><ref refid="structubthread__mutex" kindref="compound">ubthread_mutex_t</ref><sp/>ubmutex<sp/>=<sp/>*<ref refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" kindref="member">mutex</ref>;</highlight></codeline> <codeline lineno="111"><highlight class="normal"></highlight></codeline> <codeline lineno="112"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ubmutex-><ref refid="structubthread__mutex_1aac3657ca9969799cdcbc0e9e66926be2" kindref="member">lock</ref><sp/>!=<sp/><ref refid="include_2sys_2types_8h_1af6a258d8f3ee5206d682d799316314b1aa82764c3079aea4e60c80e45befbb839" kindref="member">TRUE</ref>)</highlight></codeline> <codeline lineno="113"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="armv6_2kpanic_8c_1adb9a182aa071791a306163d50d653deb" kindref="member">kpanic</ref>(</highlight><highlight class="stringliteral">"NOT<sp/>LOCKED?"</highlight><highlight class="normal">);</highlight></codeline> <codeline lineno="114"><highlight class="normal"></highlight></codeline> <codeline lineno="115"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ubmutex-><ref refid="structubthread__mutex_1a9c8643e4d9bec2a38ea1d45e82609f2a" kindref="member">pid</ref><sp/>!=<sp/><ref refid="armv6_2sched_8c_1a54397bfe18d5da4d50ff03b15f540858" kindref="member">_current</ref>-><ref refid="structtaskStruct_1a30966587a60db6b40c8be6c387e11d81" kindref="member">id</ref>)</highlight></codeline> <codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kprintf_8h_1a20b56810edb62a6fe59917015c30848f" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">"Trying<sp/>To<sp/>Unlock<sp/>Mutex<sp/>From<sp/>No<sp/>Locking<sp/>Thread[%i<sp/>-<sp/>%i:0x%X]\n"</highlight><highlight class="normal">,<sp/>ubmutex-><ref refid="structubthread__mutex_1a9c8643e4d9bec2a38ea1d45e82609f2a" kindref="member">pid</ref>,<sp/><ref refid="armv6_2sched_8c_1a54397bfe18d5da4d50ff03b15f540858" kindref="member">_current</ref>-><ref refid="structtaskStruct_1a30966587a60db6b40c8be6c387e11d81" kindref="member">id</ref>,<sp/>*ubmutex);</highlight></codeline> <codeline lineno="117"><highlight class="normal"></highlight></codeline> <codeline lineno="118"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(1)<sp/>{</highlight></codeline> <codeline lineno="119"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(xchg_32(&ubmutex-><ref refid="structubthread__mutex_1aac3657ca9969799cdcbc0e9e66926be2" kindref="member">lock</ref>,<sp/><ref refid="include_2sys_2types_8h_1af6a258d8f3ee5206d682d799316314b1aa1e095cc966dbecf6a0d8aad75348d1a" kindref="member">FALSE</ref>)<sp/>==<sp/><ref refid="include_2sys_2types_8h_1af6a258d8f3ee5206d682d799316314b1aa82764c3079aea4e60c80e45befbb839" kindref="member">TRUE</ref>)</highlight></codeline> <codeline lineno="120"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline> <codeline lineno="121"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(ubmutex-><ref refid="structubthread__mutex_1aac3657ca9969799cdcbc0e9e66926be2" kindref="member">lock</ref><sp/>==<sp/><ref refid="include_2sys_2types_8h_1af6a258d8f3ee5206d682d799316314b1aa1e095cc966dbecf6a0d8aad75348d1a" kindref="member">FALSE</ref>)</highlight></codeline> <codeline lineno="122"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="armv6_2sched_8c_1a08933fe6d593a1c78b9080359f15a0b7" kindref="member">sched_yield</ref>();</highlight></codeline> <codeline lineno="123"><highlight class="normal"><sp/><sp/>}</highlight></codeline> <codeline lineno="124"><highlight class="normal"></highlight></codeline> <codeline lineno="125"><highlight class="normal"><sp/><sp/>ubmutex-><ref refid="structubthread__mutex_1a9c8643e4d9bec2a38ea1d45e82609f2a" kindref="member">pid</ref><sp/>=<sp/>0x0;</highlight></codeline> <codeline lineno="126"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline> <codeline lineno="127"><highlight class="normal">}</highlight></codeline> <codeline lineno="128"><highlight class="normal"></highlight></codeline> <codeline lineno="129" refid="ubthread_8c_1a996be9a927447a62f7168a082a046c54" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ubthread_8c_1a996be9a927447a62f7168a082a046c54" kindref="member">ubthread_cond_timedwait</ref>(<ref refid="structubthread__cond" kindref="compound">ubthread_cond_t</ref><sp/>*cond,<sp/><ref refid="structubthread__mutex" kindref="compound">ubthread_mutex_t</ref><sp/>*<ref refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" kindref="member">mutex</ref>,<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structtimespec" kindref="compound">timespec</ref><sp/>*abstime)<sp/>{</highlight></codeline> <codeline lineno="130"><highlight class="normal"><sp/><sp/><ref refid="structubthread__cond" kindref="compound">ubthread_cond_t</ref><sp/>ubcond<sp/>=<sp/>*cond;</highlight></codeline> <codeline lineno="131"><highlight class="normal"><sp/><sp/><ref refid="structubthread__mutex" kindref="compound">ubthread_mutex_t</ref><sp/>ubmutex<sp/>=<sp/>*<ref refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" kindref="member">mutex</ref>;</highlight></codeline> <codeline lineno="132"><highlight class="normal"></highlight></codeline> <codeline lineno="133"><highlight class="normal"><sp/><sp/><ref refid="include_2sys_2types_8h_1a0238af00180b6d9278fa1c6aa790fdf4" kindref="member">uint32_t</ref><sp/>enterTime<sp/>=<sp/><ref refid="vitals_8h_1a67aae71be472453526fc1a0bfbf80280" kindref="member">systemVitals</ref>-><ref refid="structvitalsStruct_1a78832d978f9753eb94bf615dc215f511" kindref="member">sysUptime</ref><sp/>+<sp/>20;</highlight></codeline> <codeline lineno="134"><highlight class="normal"></highlight></codeline> <codeline lineno="135"><highlight class="normal"><sp/><sp/><ref refid="ubthread_8c_1afea3530bab360f59c09a49f490d079dd" kindref="member">ubthread_mutex_unlock</ref>(<ref refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" kindref="member">mutex</ref>);</highlight></codeline> <codeline lineno="136"><highlight class="normal"></highlight></codeline> <codeline lineno="137"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(enterTime<sp/>><sp/><ref refid="vitals_8h_1a67aae71be472453526fc1a0bfbf80280" kindref="member">systemVitals</ref>-><ref refid="structvitalsStruct_1a78832d978f9753eb94bf615dc215f511" kindref="member">sysUptime</ref>)<sp/>{</highlight></codeline> <codeline lineno="138"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ubcond-><ref refid="structubthread__cond_1aae369fe44ca2aee0e9e0df01a5dda323" kindref="member">lock</ref><sp/>==<sp/><ref refid="include_2sys_2types_8h_1af6a258d8f3ee5206d682d799316314b1aa1e095cc966dbecf6a0d8aad75348d1a" kindref="member">FALSE</ref>)</highlight></codeline> <codeline lineno="139"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline> <codeline lineno="140"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="armv6_2sched_8c_1a08933fe6d593a1c78b9080359f15a0b7" kindref="member">sched_yield</ref>();</highlight></codeline> <codeline lineno="141"><highlight class="normal"><sp/><sp/>}</highlight></codeline> <codeline lineno="142"><highlight class="normal"></highlight></codeline> <codeline lineno="143"><highlight class="normal"><sp/><sp/><ref refid="ubthread_8c_1aa13bf141cd3e9bf0921fbf61ffc637d8" kindref="member">ubthread_mutex_lock</ref>(<ref refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" kindref="member">mutex</ref>);</highlight></codeline> <codeline lineno="144"><highlight class="normal"></highlight></codeline> <codeline lineno="145"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline> <codeline lineno="146"><highlight class="normal">}</highlight></codeline> <codeline lineno="147"><highlight class="normal"></highlight></codeline> <codeline lineno="148" refid="ubthread_8c_1a30eb7c156c2422801ddb86326dbc3d81" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ubthread_8c_1a30eb7c156c2422801ddb86326dbc3d81" kindref="member">ubthread_cond_wait</ref>(<ref refid="structubthread__cond" kindref="compound">ubthread_cond_t</ref><sp/>*cond,<sp/><ref refid="structubthread__mutex" kindref="compound">ubthread_mutex_t</ref><sp/>*<ref refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" kindref="member">mutex</ref>)<sp/>{</highlight></codeline> <codeline lineno="149"><highlight class="normal"><sp/><sp/><ref refid="structubthread__cond" kindref="compound">ubthread_cond_t</ref><sp/>ubcond<sp/>=<sp/>*cond;</highlight></codeline> <codeline lineno="150"><highlight class="normal"><sp/><sp/><ref refid="ubthread_8c_1afea3530bab360f59c09a49f490d079dd" kindref="member">ubthread_mutex_unlock</ref>(<ref refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" kindref="member">mutex</ref>);</highlight></codeline> <codeline lineno="151"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(ubcond-><ref refid="structubthread__cond_1aae369fe44ca2aee0e9e0df01a5dda323" kindref="member">lock</ref><sp/>==<sp/><ref refid="include_2sys_2types_8h_1af6a258d8f3ee5206d682d799316314b1aa82764c3079aea4e60c80e45befbb839" kindref="member">TRUE</ref>)</highlight></codeline> <codeline lineno="152"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="armv6_2sched_8c_1a08933fe6d593a1c78b9080359f15a0b7" kindref="member">sched_yield</ref>();</highlight></codeline> <codeline lineno="153"><highlight class="normal"><sp/><sp/><ref refid="ubthread_8c_1aa13bf141cd3e9bf0921fbf61ffc637d8" kindref="member">ubthread_mutex_lock</ref>(<ref refid="ubthread_8c_1a18b6be9ca0cec4b0643171232d6f10de" kindref="member">mutex</ref>);</highlight></codeline> <codeline lineno="154"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline> <codeline lineno="155"><highlight class="normal">}</highlight></codeline> <codeline lineno="156"><highlight class="normal"></highlight></codeline> <codeline lineno="157" refid="ubthread_8c_1a64fb8f5f2da2564a6cae8c9f2c3bde10" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ubthread_8c_1a64fb8f5f2da2564a6cae8c9f2c3bde10" kindref="member">ubthread_cond_signal</ref>(<ref refid="structubthread__cond" kindref="compound">ubthread_cond_t</ref><sp/>*cond)<sp/>{</highlight></codeline> <codeline lineno="158"><highlight class="normal"><sp/><sp/><ref refid="structubthread__cond" kindref="compound">ubthread_cond_t</ref><sp/>ubcond<sp/>=<sp/>*cond;</highlight></codeline> <codeline lineno="159"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(xchg_32(&ubcond-><ref refid="structubthread__cond_1aae369fe44ca2aee0e9e0df01a5dda323" kindref="member">lock</ref>,<sp/><ref refid="include_2sys_2types_8h_1af6a258d8f3ee5206d682d799316314b1aa1e095cc966dbecf6a0d8aad75348d1a" kindref="member">FALSE</ref>))</highlight></codeline> <codeline lineno="160"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="armv6_2sched_8c_1a08933fe6d593a1c78b9080359f15a0b7" kindref="member">sched_yield</ref>();</highlight></codeline> <codeline lineno="161"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline> <codeline lineno="162"><highlight class="normal">}</highlight></codeline> <codeline lineno="163"><highlight class="normal"></highlight></codeline> <codeline lineno="164" refid="ubthread_8c_1aeb2f756a095ecfddad31354f819623ee" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ubthread_8c_1aeb2f756a095ecfddad31354f819623ee" kindref="member">ubthread_cond_broadcast</ref>(<ref refid="structubthread__cond" kindref="compound">ubthread_cond_t</ref><sp/>*cond)<sp/>{</highlight></codeline> <codeline lineno="165"><highlight class="normal"><sp/><sp/><ref refid="structubthread__cond" kindref="compound">ubthread_cond_t</ref><sp/>ubcond<sp/>=<sp/>*cond;</highlight></codeline> <codeline lineno="166"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(xchg_32(&ubcond-><ref refid="structubthread__cond_1aae369fe44ca2aee0e9e0df01a5dda323" kindref="member">lock</ref>,<sp/><ref refid="include_2sys_2types_8h_1af6a258d8f3ee5206d682d799316314b1aa1e095cc966dbecf6a0d8aad75348d1a" kindref="member">FALSE</ref>))</highlight></codeline> <codeline lineno="167"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="armv6_2sched_8c_1a08933fe6d593a1c78b9080359f15a0b7" kindref="member">sched_yield</ref>();</highlight></codeline> <codeline lineno="168"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0x0);</highlight></codeline> <codeline lineno="169"><highlight class="normal">}</highlight></codeline> <codeline lineno="170"><highlight class="normal"></highlight></codeline> </programlisting> <location file="C:/Dev/git/UbixOS/sys/kernel/ubthread.c"/> </compounddef> </doxygen>