Files

1232 lines
175 KiB
Plaintext

<!DOCTYPE html>
<html lang="en-US">
<!--
Copyright (c) 1999-2026 by the D Language Foundation
All Rights Reserved.
https://dlang.org/foundation_overview.html
-->
<head>
<meta charset="utf-8">
<meta name="keywords" content="D programming language">
<meta name="description" content="D Programming Language">
<title>std.concurrency - D Programming Language</title>
<link rel="stylesheet" href="../css/codemirror.css">
<link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="../css/print.css" media="print">
<link rel="shortcut icon" href="../favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.1, maximum-scale=10.0">
</head>
<body id='std.concurrency' class='std'>
<script type="text/javascript">document.body.className += ' have-javascript'</script>
<div id="top"><div class="helper"><div class="helper expand-container"> <div class="logo"><a href=".."><img id="logo" alt="D Logo" src="../images/dlogo.svg"></a></div>
<a href="../menu.html" title="Menu" class="hamburger expand-toggle"><span>Menu</span></a>
<div id="cssmenu"><ul> <li><a href='https://tour.dlang.org'><span>Learn</span></a></li>
<li class='expand-container'><a class='expand-toggle' href='../documentation.html'><span>Documentation</span></a>
<ul class='expand-content'> <li><a href='../spec/spec.html'>Language Reference</a></li>
<li><a href='../phobos/index.html'>Library Reference</a></li>
<li><a href='../dmd.html'>Command-line Reference</a></li>
<li class="menu-divider"><a href='../comparison.html'>Feature Overview</a></li>
<li><a href='../articles.html'>Articles</a></li>
</ul></li>
<li><a href='../download.html'><span>Downloads</span></a></li>
<li><a href='https://code.dlang.org'><span>Packages</span></a></li>
<li class='expand-container'><a class='expand-toggle' href='../community.html'><span>Community</span></a>
<ul class='expand-content'> <li><a href='https://blog.dlang.org'>Blog</a></li>
<li><a href='../orgs-using-d.html'>Orgs using D</a></li>
<li><a href='https://twitter.com/search?q=%23dlang'>Twitter</a></li>
<li class="menu-divider"><a href='https://discord.gg/bMZk9Q4'>Discord (community-run)</a></li>
<li><a href='https://forum.dlang.org'>Forums</a></li>
<li><a href='irc://irc.libera.chat/d'>IRC</a></li>
<li><a href='https://wiki.dlang.org'>Wiki</a></li>
<li class="menu-divider"><a href='../bugstats.html'>Issues</a></li>
<li><a href='../contributing.html'>Contributing</a></li>
<li class="menu-divider"><a href='../foundation/contributors.html'>Contributors</a></li>
<li><a href='../foundation/index.html'>Foundation</a></li>
<li><a href='..//security.html'>Security Team</a></li>
<li class="menu-divider"><a href='https://store.dlang.org/'>Store</a></li>
<li><a href='../foundation/donate.html'>Donate</a></li>
<li><a href='../foundation/sponsors.html'>Sponsors</a></li>
</ul></li>
<li class='expand-container'><a class='expand-toggle' href='../resources.html'><span>Resources</span></a>
<ul class='expand-content'> <li><a href='https://tour.dlang.org'>Tour</a></li>
<li><a href='https://wiki.dlang.org/Books'>Books</a></li>
<li><a href='https://wiki.dlang.org/Tutorials'>Tutorials</a></li>
<li class="menu-divider"><a href='https://wiki.dlang.org/Development_tools'>Tools</a></li>
<li><a href='https://wiki.dlang.org/Editors'>Editors</a></li>
<li><a href='https://wiki.dlang.org/IDEs'>IDEs</a></li>
<li><a href='https://run.dlang.io'>run.dlang.io</a></li>
<li><a href='http://rainers.github.io/visuald/visuald/StartPage.html'>Visual D</a></li>
<li class="menu-divider"><a href='../acknowledgements.html'>Acknowledgments</a></li>
<li><a href='../dstyle.html'>D Style</a></li>
<li><a href='../spec/glossary.html'>Glossary</a></li>
<li><a href='../sitemap.html'>Sitemap</a></li>
</ul></li>
</ul></div>
<div class="search-container expand-container"> <a href="../search.html" class="expand-toggle" title="Search"><span>Search</span></a>
<div id="search-box"> <form method="get" action="https://google.com/search">
<input type="hidden" id="domains" name="domains" value="dlang.org">
<input type="hidden" id="sourceid" name="sourceid" value="google-search">
<span id="search-query"><input id="q" name="q" placeholder="Google Search"></span><span id="search-dropdown"><span class="helper"> <select id="sitesearch" name="sitesearch" size="1">
<option value="dlang.org">Entire Site</option>
<option value="dlang.org/spec">Language</option>
<option selected value="dlang.org/phobos">Library</option>
<option value="forum.dlang.org">Forums</option>
</select>
</span></span><span id="search-submit"><button type="submit"><i class="fa fa-search"></i><span>go</span></button></span>
</form>
</div>
</div>
</div></div></div>
<div class="container">
<div class="subnav-helper"></div> <div class="subnav"> <div class="head"> <h2>Library Reference</h2>
<p><span class="smallprint">version 2.113.0 <span class="separator"><br></span>
</span>
</p>
<p><a href="index.html">overview</a></p>
</div>
<ul>
<li><a href='object.html'><span><em class="tt">object</em></span></a></li>
<li class='expand-container modlist-submenu-std'><a class='expand-toggle' href='#'><span><em class="tt">std</em></span></a>
<ul><li> <a href="std_algorithm.html" title="std.algorithm"><span class="d_inlinecode donthyphenate notranslate">algorithm</span></a><ul><li> <a href="std_algorithm_comparison.html" title="std.algorithm.comparison"><span class="d_inlinecode donthyphenate notranslate">comparison</span></a></li><li> <a href="std_algorithm_iteration.html" title="std.algorithm.iteration"><span class="d_inlinecode donthyphenate notranslate">iteration</span></a></li><li> <a href="std_algorithm_mutation.html" title="std.algorithm.mutation"><span class="d_inlinecode donthyphenate notranslate">mutation</span></a></li><li> <a href="std_algorithm_searching.html" title="std.algorithm.searching"><span class="d_inlinecode donthyphenate notranslate">searching</span></a></li><li> <a href="std_algorithm_setops.html" title="std.algorithm.setops"><span class="d_inlinecode donthyphenate notranslate">setops</span></a></li><li> <a href="std_algorithm_sorting.html" title="std.algorithm.sorting"><span class="d_inlinecode donthyphenate notranslate">sorting</span></a>
</li></ul></li><li> <a href="std_array.html" title="std.array"><span class="d_inlinecode donthyphenate notranslate">array</span></a></li><li> <a href="std_ascii.html" title="std.ascii"><span class="d_inlinecode donthyphenate notranslate">ascii</span></a></li><li> <a href="std_base64.html" title="std.base64"><span class="d_inlinecode donthyphenate notranslate">base64</span></a></li><li> <a href="std_bigint.html" title="std.bigint"><span class="d_inlinecode donthyphenate notranslate">bigint</span></a></li><li> <a href="std_bitmanip.html" title="std.bitmanip"><span class="d_inlinecode donthyphenate notranslate">bitmanip</span></a></li><li> <a href="std_checkedint.html" title="std.checkedint"><span class="d_inlinecode donthyphenate notranslate">checkedint</span></a></li><li> <a href="std_compiler.html" title="std.compiler"><span class="d_inlinecode donthyphenate notranslate">compiler</span></a></li><li> <a href="std_complex.html" title="std.complex"><span class="d_inlinecode donthyphenate notranslate">complex</span></a></li><li> <a href="std_concurrency.html" title="std.concurrency"><span class="d_inlinecode donthyphenate notranslate">concurrency</span></a></li><li> <a href="std_container.html" title="std.container"><span class="d_inlinecode donthyphenate notranslate">container</span></a><ul><li> <a href="std_container_array.html" title="std.container.array"><span class="d_inlinecode donthyphenate notranslate">array</span></a></li><li> <a href="std_container_binaryheap.html" title="std.container.binaryheap"><span class="d_inlinecode donthyphenate notranslate">binaryheap</span></a></li><li> <a href="std_container_dlist.html" title="std.container.dlist"><span class="d_inlinecode donthyphenate notranslate">dlist</span></a></li><li> <a href="std_container_rbtree.html" title="std.container.rbtree"><span class="d_inlinecode donthyphenate notranslate">rbtree</span></a></li><li> <a href="std_container_slist.html" title="std.container.slist"><span class="d_inlinecode donthyphenate notranslate">slist</span></a></li><li> <a href="std_container_util.html" title="std.container.util"><span class="d_inlinecode donthyphenate notranslate">util</span></a>
</li></ul></li><li> <a href="std_conv.html" title="std.conv"><span class="d_inlinecode donthyphenate notranslate">conv</span></a></li><li> <a href="std_csv.html" title="std.csv"><span class="d_inlinecode donthyphenate notranslate">csv</span></a></li><li> <a href="std_datetime.html" title="std.datetime"><span class="d_inlinecode donthyphenate notranslate">datetime</span></a><ul><li> <a href="std_datetime_date.html" title="std.datetime.date"><span class="d_inlinecode donthyphenate notranslate">date</span></a></li><li> <a href="std_datetime_interval.html" title="std.datetime.interval"><span class="d_inlinecode donthyphenate notranslate">interval</span></a></li><li> <a href="std_datetime_stopwatch.html" title="std.datetime.stopwatch"><span class="d_inlinecode donthyphenate notranslate">stopwatch</span></a></li><li> <a href="std_datetime_systime.html" title="std.datetime.systime"><span class="d_inlinecode donthyphenate notranslate">systime</span></a></li><li> <a href="std_datetime_timezone.html" title="std.datetime.timezone"><span class="d_inlinecode donthyphenate notranslate">timezone</span></a>
</li></ul></li><li> <a href="std_demangle.html" title="std.demangle"><span class="d_inlinecode donthyphenate notranslate">demangle</span></a></li><li> <a href="std_digest.html" title="std.digest"><span class="d_inlinecode donthyphenate notranslate">digest</span></a><ul><li> <a href="std_digest_crc.html" title="std.digest.crc"><span class="d_inlinecode donthyphenate notranslate">crc</span></a></li><li> <a href="std_digest_hmac.html" title="std.digest.hmac"><span class="d_inlinecode donthyphenate notranslate">hmac</span></a></li><li> <a href="std_digest_md.html" title="std.digest.md"><span class="d_inlinecode donthyphenate notranslate">md</span></a></li><li> <a href="std_digest_murmurhash.html" title="std.digest.murmurhash"><span class="d_inlinecode donthyphenate notranslate">murmurhash</span></a></li><li> <a href="std_digest_ripemd.html" title="std.digest.ripemd"><span class="d_inlinecode donthyphenate notranslate">ripemd</span></a></li><li> <a href="std_digest_sha.html" title="std.digest.sha"><span class="d_inlinecode donthyphenate notranslate">sha</span></a>
</li></ul></li><li> <a href="std_encoding.html" title="std.encoding"><span class="d_inlinecode donthyphenate notranslate">encoding</span></a></li><li> <a href="std_exception.html" title="std.exception"><span class="d_inlinecode donthyphenate notranslate">exception</span></a></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">experimental</span></h7><ul><li> <a href="std_experimental_allocator.html" title="std.experimental.allocator"><span class="d_inlinecode donthyphenate notranslate">allocator</span></a><ul><li> <a href="std_experimental_allocator_building_blocks.html" title="std.experimental.allocator.building_blocks"><span class="d_inlinecode donthyphenate notranslate">building_blocks</span></a><ul><li> <a href="std_experimental_allocator_building_blocks_affix_allocator.html" title="std.experimental.allocator.building_blocks.affix_allocator"><span class="d_inlinecode donthyphenate notranslate">affix_allocator</span></a></li><li> <a href="std_experimental_allocator_building_blocks_aligned_block_list.html" title="std.experimental.allocator.building_blocks.aligned_block_list"><span class="d_inlinecode donthyphenate notranslate">aligned_block_list</span></a></li><li> <a href="std_experimental_allocator_building_blocks_allocator_list.html" title="std.experimental.allocator.building_blocks.allocator_list"><span class="d_inlinecode donthyphenate notranslate">allocator_list</span></a></li><li> <a href="std_experimental_allocator_building_blocks_ascending_page_allocator.html" title="std.experimental.allocator.building_blocks.ascending_page_allocator"><span class="d_inlinecode donthyphenate notranslate">ascending_page_allocator</span></a></li><li> <a href="std_experimental_allocator_building_blocks_bitmapped_block.html" title="std.experimental.allocator.building_blocks.bitmapped_block"><span class="d_inlinecode donthyphenate notranslate">bitmapped_block</span></a></li><li> <a href="std_experimental_allocator_building_blocks_bucketizer.html" title="std.experimental.allocator.building_blocks.bucketizer"><span class="d_inlinecode donthyphenate notranslate">bucketizer</span></a></li><li> <a href="std_experimental_allocator_building_blocks_fallback_allocator.html" title="std.experimental.allocator.building_blocks.fallback_allocator"><span class="d_inlinecode donthyphenate notranslate">fallback_allocator</span></a></li><li> <a href="std_experimental_allocator_building_blocks_free_list.html" title="std.experimental.allocator.building_blocks.free_list"><span class="d_inlinecode donthyphenate notranslate">free_list</span></a></li><li> <a href="std_experimental_allocator_building_blocks_free_tree.html" title="std.experimental.allocator.building_blocks.free_tree"><span class="d_inlinecode donthyphenate notranslate">free_tree</span></a></li><li> <a href="std_experimental_allocator_building_blocks_kernighan_ritchie.html" title="std.experimental.allocator.building_blocks.kernighan_ritchie"><span class="d_inlinecode donthyphenate notranslate">kernighan_ritchie</span></a></li><li> <a href="std_experimental_allocator_building_blocks_null_allocator.html" title="std.experimental.allocator.building_blocks.null_allocator"><span class="d_inlinecode donthyphenate notranslate">null_allocator</span></a></li><li> <a href="std_experimental_allocator_building_blocks_quantizer.html" title="std.experimental.allocator.building_blocks.quantizer"><span class="d_inlinecode donthyphenate notranslate">quantizer</span></a></li><li> <a href="std_experimental_allocator_building_blocks_region.html" title="std.experimental.allocator.building_blocks.region"><span class="d_inlinecode donthyphenate notranslate">region</span></a></li><li> <a href="std_experimental_allocator_building_blocks_scoped_allocator.html" title="std.experimental.allocator.building_blocks.scoped_allocator"><span class="d_inlinecode donthyphenate notranslate">scoped_allocator</span></a></li><li> <a href="std_experimental_allocator_building_blocks_segregator.html" title="std.experimental.allocator.building_blocks.segregator"><span class="d_inlinecode donthyphenate notranslate">segregator</span></a></li><li> <a href="std_experimental_allocator_building_blocks_stats_collector.html" title="std.experimental.allocator.building_blocks.stats_collector"><span class="d_inlinecode donthyphenate notranslate">stats_collector</span></a>
</li></ul></li><li> <a href="std_experimental_allocator_common.html" title="std.experimental.allocator.common"><span class="d_inlinecode donthyphenate notranslate">common</span></a></li><li> <a href="std_experimental_allocator_gc_allocator.html" title="std.experimental.allocator.gc_allocator"><span class="d_inlinecode donthyphenate notranslate">gc_allocator</span></a></li><li> <a href="std_experimental_allocator_mallocator.html" title="std.experimental.allocator.mallocator"><span class="d_inlinecode donthyphenate notranslate">mallocator</span></a></li><li> <a href="std_experimental_allocator_mmap_allocator.html" title="std.experimental.allocator.mmap_allocator"><span class="d_inlinecode donthyphenate notranslate">mmap_allocator</span></a></li><li> <a href="std_experimental_allocator_showcase.html" title="std.experimental.allocator.showcase"><span class="d_inlinecode donthyphenate notranslate">showcase</span></a></li><li> <a href="std_experimental_allocator_typed.html" title="std.experimental.allocator.typed"><span class="d_inlinecode donthyphenate notranslate">typed</span></a>
</li></ul></li><li> <a href="std_experimental_checkedint.html" title="std.experimental.checkedint"><span class="d_inlinecode donthyphenate notranslate">checkedint</span></a></li><li> <a href="std_experimental_logger.html" title="std.experimental.logger"><span class="d_inlinecode donthyphenate notranslate">logger</span></a><ul><li> <a href="std_experimental_logger_core.html" title="std.experimental.logger.core"><span class="d_inlinecode donthyphenate notranslate">core</span></a></li><li> <a href="std_experimental_logger_filelogger.html" title="std.experimental.logger.filelogger"><span class="d_inlinecode donthyphenate notranslate">filelogger</span></a></li><li> <a href="std_experimental_logger_multilogger.html" title="std.experimental.logger.multilogger"><span class="d_inlinecode donthyphenate notranslate">multilogger</span></a></li><li> <a href="std_experimental_logger_nulllogger.html" title="std.experimental.logger.nulllogger"><span class="d_inlinecode donthyphenate notranslate">nulllogger</span></a>
</li></ul>
</li></ul></li><li> <a href="std_file.html" title="std.file"><span class="d_inlinecode donthyphenate notranslate">file</span></a></li><li> <a href="std_format.html" title="std.format"><span class="d_inlinecode donthyphenate notranslate">format</span></a><ul><li> <h7><span class="d_inlinecode donthyphenate notranslate">internal</span></h7><ul><li> <a href="std_format_internal_floats.html" title="std.format.internal.floats"><span class="d_inlinecode donthyphenate notranslate">floats</span></a></li><li> <a href="std_format_internal_read.html" title="std.format.internal.read"><span class="d_inlinecode donthyphenate notranslate">read</span></a></li><li> <a href="std_format_internal_write.html" title="std.format.internal.write"><span class="d_inlinecode donthyphenate notranslate">write</span></a>
</li></ul></li><li> <a href="std_format_read.html" title="std.format.read"><span class="d_inlinecode donthyphenate notranslate">read</span></a></li><li> <a href="std_format_spec.html" title="std.format.spec"><span class="d_inlinecode donthyphenate notranslate">spec</span></a></li><li> <a href="std_format_write.html" title="std.format.write"><span class="d_inlinecode donthyphenate notranslate">write</span></a>
</li></ul></li><li> <a href="std_functional.html" title="std.functional"><span class="d_inlinecode donthyphenate notranslate">functional</span></a></li><li> <a href="std_getopt.html" title="std.getopt"><span class="d_inlinecode donthyphenate notranslate">getopt</span></a></li><li> <a href="std_int128.html" title="std.int128"><span class="d_inlinecode donthyphenate notranslate">int128</span></a></li><li> <a href="std_json.html" title="std.json"><span class="d_inlinecode donthyphenate notranslate">json</span></a></li><li> <a href="std_logger.html" title="std.logger"><span class="d_inlinecode donthyphenate notranslate">logger</span></a><ul><li> <a href="std_logger_core.html" title="std.logger.core"><span class="d_inlinecode donthyphenate notranslate">core</span></a></li><li> <a href="std_logger_filelogger.html" title="std.logger.filelogger"><span class="d_inlinecode donthyphenate notranslate">filelogger</span></a></li><li> <a href="std_logger_multilogger.html" title="std.logger.multilogger"><span class="d_inlinecode donthyphenate notranslate">multilogger</span></a></li><li> <a href="std_logger_nulllogger.html" title="std.logger.nulllogger"><span class="d_inlinecode donthyphenate notranslate">nulllogger</span></a>
</li></ul></li><li> <a href="std_math.html" title="std.math"><span class="d_inlinecode donthyphenate notranslate">math</span></a><ul><li> <a href="std_math_algebraic.html" title="std.math.algebraic"><span class="d_inlinecode donthyphenate notranslate">algebraic</span></a></li><li> <a href="std_math_constants.html" title="std.math.constants"><span class="d_inlinecode donthyphenate notranslate">constants</span></a></li><li> <a href="std_math_exponential.html" title="std.math.exponential"><span class="d_inlinecode donthyphenate notranslate">exponential</span></a></li><li> <a href="std_math_hardware.html" title="std.math.hardware"><span class="d_inlinecode donthyphenate notranslate">hardware</span></a></li><li> <a href="std_math_operations.html" title="std.math.operations"><span class="d_inlinecode donthyphenate notranslate">operations</span></a></li><li> <a href="std_math_remainder.html" title="std.math.remainder"><span class="d_inlinecode donthyphenate notranslate">remainder</span></a></li><li> <a href="std_math_rounding.html" title="std.math.rounding"><span class="d_inlinecode donthyphenate notranslate">rounding</span></a></li><li> <a href="std_math_traits.html" title="std.math.traits"><span class="d_inlinecode donthyphenate notranslate">traits</span></a></li><li> <a href="std_math_trigonometry.html" title="std.math.trigonometry"><span class="d_inlinecode donthyphenate notranslate">trigonometry</span></a>
</li></ul></li><li> <a href="std_mathspecial.html" title="std.mathspecial"><span class="d_inlinecode donthyphenate notranslate">mathspecial</span></a></li><li> <a href="std_meta.html" title="std.meta"><span class="d_inlinecode donthyphenate notranslate">meta</span></a></li><li> <a href="std_mmfile.html" title="std.mmfile"><span class="d_inlinecode donthyphenate notranslate">mmfile</span></a></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">net</span></h7><ul><li> <a href="std_net_curl.html" title="std.net.curl"><span class="d_inlinecode donthyphenate notranslate">curl</span></a></li><li> <a href="std_net_isemail.html" title="std.net.isemail"><span class="d_inlinecode donthyphenate notranslate">isemail</span></a>
</li></ul></li><li> <a href="std_numeric.html" title="std.numeric"><span class="d_inlinecode donthyphenate notranslate">numeric</span></a></li><li> <a href="std_outbuffer.html" title="std.outbuffer"><span class="d_inlinecode donthyphenate notranslate">outbuffer</span></a></li><li> <a href="std_parallelism.html" title="std.parallelism"><span class="d_inlinecode donthyphenate notranslate">parallelism</span></a></li><li> <a href="std_path.html" title="std.path"><span class="d_inlinecode donthyphenate notranslate">path</span></a></li><li> <a href="std_process.html" title="std.process"><span class="d_inlinecode donthyphenate notranslate">process</span></a></li><li> <a href="std_random.html" title="std.random"><span class="d_inlinecode donthyphenate notranslate">random</span></a></li><li> <a href="std_range.html" title="std.range"><span class="d_inlinecode donthyphenate notranslate">range</span></a><ul><li> <a href="std_range_interfaces.html" title="std.range.interfaces"><span class="d_inlinecode donthyphenate notranslate">interfaces</span></a></li><li> <a href="std_range_primitives.html" title="std.range.primitives"><span class="d_inlinecode donthyphenate notranslate">primitives</span></a>
</li></ul></li><li> <a href="std_regex.html" title="std.regex"><span class="d_inlinecode donthyphenate notranslate">regex</span></a></li><li> <a href="std_signals.html" title="std.signals"><span class="d_inlinecode donthyphenate notranslate">signals</span></a></li><li> <a href="std_socket.html" title="std.socket"><span class="d_inlinecode donthyphenate notranslate">socket</span></a></li><li> <a href="std_stdint.html" title="std.stdint"><span class="d_inlinecode donthyphenate notranslate">stdint</span></a></li><li> <a href="std_stdio.html" title="std.stdio"><span class="d_inlinecode donthyphenate notranslate">stdio</span></a></li><li> <a href="std_string.html" title="std.string"><span class="d_inlinecode donthyphenate notranslate">string</span></a></li><li> <a href="std_sumtype.html" title="std.sumtype"><span class="d_inlinecode donthyphenate notranslate">sumtype</span></a></li><li> <a href="std_system.html" title="std.system"><span class="d_inlinecode donthyphenate notranslate">system</span></a></li><li> <a href="std_traits.html" title="std.traits"><span class="d_inlinecode donthyphenate notranslate">traits</span></a></li><li> <a href="std_typecons.html" title="std.typecons"><span class="d_inlinecode donthyphenate notranslate">typecons</span></a></li><li> <a href="std_uni.html" title="std.uni"><span class="d_inlinecode donthyphenate notranslate">uni</span></a></li><li> <a href="std_uri.html" title="std.uri"><span class="d_inlinecode donthyphenate notranslate">uri</span></a></li><li> <a href="std_utf.html" title="std.utf"><span class="d_inlinecode donthyphenate notranslate">utf</span></a></li><li> <a href="std_uuid.html" title="std.uuid"><span class="d_inlinecode donthyphenate notranslate">uuid</span></a></li><li> <a href="std_variant.html" title="std.variant"><span class="d_inlinecode donthyphenate notranslate">variant</span></a></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">windows</span></h7><ul><li> <a href="std_windows_charset.html" title="std.windows.charset"><span class="d_inlinecode donthyphenate notranslate">charset</span></a></li><li> <a href="std_windows_syserror.html" title="std.windows.syserror"><span class="d_inlinecode donthyphenate notranslate">syserror</span></a>
</li></ul></li><li> <a href="std_zip.html" title="std.zip"><span class="d_inlinecode donthyphenate notranslate">zip</span></a></li><li> <a href="std_zlib.html" title="std.zlib"><span class="d_inlinecode donthyphenate notranslate">zlib</span></a>
</li></ul>
</li>
<li class='expand-container modlist-submenu-etc'><a class='expand-toggle' href='#'><span><em class="tt">etc</em></span></a>
<ul><li> <h7><span class="d_inlinecode donthyphenate notranslate">c</span></h7><ul><li> <a href="etc_c_curl.html" title="etc.c.curl"><span class="d_inlinecode donthyphenate notranslate">curl</span></a></li><li> <a href="etc_c_odbc.html" title="etc.c.odbc"><span class="d_inlinecode donthyphenate notranslate">odbc</span></a><ul><li> <a href="etc_c_odbc_odbc32.html" title="etc.c.odbc.odbc32"><span class="d_inlinecode donthyphenate notranslate">odbc32</span></a></li><li> <a href="etc_c_odbc_odbc64.html" title="etc.c.odbc.odbc64"><span class="d_inlinecode donthyphenate notranslate">odbc64</span></a></li><li> <a href="etc_c_odbc_sql.html" title="etc.c.odbc.sql"><span class="d_inlinecode donthyphenate notranslate">sql</span></a></li><li> <a href="etc_c_odbc_sqlext.html" title="etc.c.odbc.sqlext"><span class="d_inlinecode donthyphenate notranslate">sqlext</span></a></li><li> <a href="etc_c_odbc_sqltypes.html" title="etc.c.odbc.sqltypes"><span class="d_inlinecode donthyphenate notranslate">sqltypes</span></a></li><li> <a href="etc_c_odbc_sqlucode.html" title="etc.c.odbc.sqlucode"><span class="d_inlinecode donthyphenate notranslate">sqlucode</span></a>
</li></ul></li><li> <a href="etc_c_sqlite3.html" title="etc.c.sqlite3"><span class="d_inlinecode donthyphenate notranslate">sqlite3</span></a></li><li> <a href="etc_c_zlib.html" title="etc.c.zlib"><span class="d_inlinecode donthyphenate notranslate">zlib</span></a>
</li></ul></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">linux</span></h7><ul><li> <a href="etc_linux_memoryerror.html" title="etc.linux.memoryerror"><span class="d_inlinecode donthyphenate notranslate">memoryerror</span></a>
</li></ul></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">valgrind</span></h7><ul><li> <a href="etc_valgrind_valgrind.html" title="etc.valgrind.valgrind"><span class="d_inlinecode donthyphenate notranslate">valgrind</span></a>
</li></ul>
</li></ul>
</li>
<li class='expand-container modlist-submenu-core'><a class='expand-toggle' href='#'><span><em class="tt">core</em></span></a>
<ul><li> <a href="core_atomic.html" title="core.atomic"><span class="d_inlinecode donthyphenate notranslate">atomic</span></a></li><li> <a href="core_attribute.html" title="core.attribute"><span class="d_inlinecode donthyphenate notranslate">attribute</span></a></li><li> <a href="core_bitop.html" title="core.bitop"><span class="d_inlinecode donthyphenate notranslate">bitop</span></a></li><li> <a href="core_builtins.html" title="core.builtins"><span class="d_inlinecode donthyphenate notranslate">builtins</span></a></li><li> <a href="core_checkedint.html" title="core.checkedint"><span class="d_inlinecode donthyphenate notranslate">checkedint</span></a></li><li> <a href="core_cpuid.html" title="core.cpuid"><span class="d_inlinecode donthyphenate notranslate">cpuid</span></a></li><li> <a href="core_demangle.html" title="core.demangle"><span class="d_inlinecode donthyphenate notranslate">demangle</span></a></li><li> <a href="core_exception.html" title="core.exception"><span class="d_inlinecode donthyphenate notranslate">exception</span></a></li><li> <a href="core_factory.html" title="core.factory"><span class="d_inlinecode donthyphenate notranslate">factory</span></a></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">gc</span></h7><ul><li> <a href="core_gc_config.html" title="core.gc.config"><span class="d_inlinecode donthyphenate notranslate">config</span></a></li><li> <a href="core_gc_gcinterface.html" title="core.gc.gcinterface"><span class="d_inlinecode donthyphenate notranslate">gcinterface</span></a></li><li> <a href="core_gc_registry.html" title="core.gc.registry"><span class="d_inlinecode donthyphenate notranslate">registry</span></a>
</li></ul></li><li> <a href="core_int128.html" title="core.int128"><span class="d_inlinecode donthyphenate notranslate">int128</span></a></li><li> <a href="core_interpolation.html" title="core.interpolation"><span class="d_inlinecode donthyphenate notranslate">interpolation</span></a></li><li> <a href="core_lifetime.html" title="core.lifetime"><span class="d_inlinecode donthyphenate notranslate">lifetime</span></a></li><li> <a href="core_math.html" title="core.math"><span class="d_inlinecode donthyphenate notranslate">math</span></a></li><li> <a href="core_memory.html" title="core.memory"><span class="d_inlinecode donthyphenate notranslate">memory</span></a></li><li> <a href="core_runtime.html" title="core.runtime"><span class="d_inlinecode donthyphenate notranslate">runtime</span></a></li><li> <a href="core_simd.html" title="core.simd"><span class="d_inlinecode donthyphenate notranslate">simd</span></a></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">stdc</span></h7><ul><li> <a href="core_stdc_assert_.html" title="core.stdc.assert_"><span class="d_inlinecode donthyphenate notranslate">assert_</span></a></li><li> <a href="core_stdc_complex.html" title="core.stdc.complex"><span class="d_inlinecode donthyphenate notranslate">complex</span></a></li><li> <a href="core_stdc_ctype.html" title="core.stdc.ctype"><span class="d_inlinecode donthyphenate notranslate">ctype</span></a></li><li> <a href="core_stdc_errno.html" title="core.stdc.errno"><span class="d_inlinecode donthyphenate notranslate">errno</span></a></li><li> <a href="core_stdc_fenv.html" title="core.stdc.fenv"><span class="d_inlinecode donthyphenate notranslate">fenv</span></a></li><li> <a href="core_stdc_float_.html" title="core.stdc.float_"><span class="d_inlinecode donthyphenate notranslate">float_</span></a></li><li> <a href="core_stdc_inttypes.html" title="core.stdc.inttypes"><span class="d_inlinecode donthyphenate notranslate">inttypes</span></a></li><li> <a href="core_stdc_limits.html" title="core.stdc.limits"><span class="d_inlinecode donthyphenate notranslate">limits</span></a></li><li> <a href="core_stdc_locale.html" title="core.stdc.locale"><span class="d_inlinecode donthyphenate notranslate">locale</span></a></li><li> <a href="core_stdc_math.html" title="core.stdc.math"><span class="d_inlinecode donthyphenate notranslate">math</span></a></li><li> <a href="core_stdc_signal.html" title="core.stdc.signal"><span class="d_inlinecode donthyphenate notranslate">signal</span></a></li><li> <a href="core_stdc_stdarg.html" title="core.stdc.stdarg"><span class="d_inlinecode donthyphenate notranslate">stdarg</span></a></li><li> <a href="core_stdc_stdatomic.html" title="core.stdc.stdatomic"><span class="d_inlinecode donthyphenate notranslate">stdatomic</span></a></li><li> <a href="core_stdc_stddef.html" title="core.stdc.stddef"><span class="d_inlinecode donthyphenate notranslate">stddef</span></a></li><li> <a href="core_stdc_stdint.html" title="core.stdc.stdint"><span class="d_inlinecode donthyphenate notranslate">stdint</span></a></li><li> <a href="core_stdc_stdio.html" title="core.stdc.stdio"><span class="d_inlinecode donthyphenate notranslate">stdio</span></a></li><li> <a href="core_stdc_stdlib.html" title="core.stdc.stdlib"><span class="d_inlinecode donthyphenate notranslate">stdlib</span></a></li><li> <a href="core_stdc_string.html" title="core.stdc.string"><span class="d_inlinecode donthyphenate notranslate">string</span></a></li><li> <a href="core_stdc_tgmath.html" title="core.stdc.tgmath"><span class="d_inlinecode donthyphenate notranslate">tgmath</span></a></li><li> <a href="core_stdc_time.html" title="core.stdc.time"><span class="d_inlinecode donthyphenate notranslate">time</span></a></li><li> <a href="core_stdc_wchar_.html" title="core.stdc.wchar_"><span class="d_inlinecode donthyphenate notranslate">wchar_</span></a></li><li> <a href="core_stdc_wctype.html" title="core.stdc.wctype"><span class="d_inlinecode donthyphenate notranslate">wctype</span></a>
</li></ul></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">stdcpp</span></h7><ul><li> <a href="core_stdcpp_allocator.html" title="core.stdcpp.allocator"><span class="d_inlinecode donthyphenate notranslate">allocator</span></a></li><li> <a href="core_stdcpp_array.html" title="core.stdcpp.array"><span class="d_inlinecode donthyphenate notranslate">array</span></a></li><li> <a href="core_stdcpp_exception.html" title="core.stdcpp.exception"><span class="d_inlinecode donthyphenate notranslate">exception</span></a></li><li> <a href="core_stdcpp_memory.html" title="core.stdcpp.memory"><span class="d_inlinecode donthyphenate notranslate">memory</span></a></li><li> <a href="core_stdcpp_new_.html" title="core.stdcpp.new_"><span class="d_inlinecode donthyphenate notranslate">new_</span></a></li><li> <a href="core_stdcpp_string.html" title="core.stdcpp.string"><span class="d_inlinecode donthyphenate notranslate">string</span></a></li><li> <a href="core_stdcpp_string_view.html" title="core.stdcpp.string_view"><span class="d_inlinecode donthyphenate notranslate">string_view</span></a></li><li> <a href="core_stdcpp_type_traits.html" title="core.stdcpp.type_traits"><span class="d_inlinecode donthyphenate notranslate">type_traits</span></a></li><li> <a href="core_stdcpp_typeinfo.html" title="core.stdcpp.typeinfo"><span class="d_inlinecode donthyphenate notranslate">typeinfo</span></a></li><li> <a href="core_stdcpp_utility.html" title="core.stdcpp.utility"><span class="d_inlinecode donthyphenate notranslate">utility</span></a></li><li> <a href="core_stdcpp_vector.html" title="core.stdcpp.vector"><span class="d_inlinecode donthyphenate notranslate">vector</span></a></li><li> <a href="core_stdcpp_xutility.html" title="core.stdcpp.xutility"><span class="d_inlinecode donthyphenate notranslate">xutility</span></a>
</li></ul></li><li> <a href="core_sync.html" title="core.sync"><span class="d_inlinecode donthyphenate notranslate">sync</span></a><ul><li> <a href="core_sync_barrier.html" title="core.sync.barrier"><span class="d_inlinecode donthyphenate notranslate">barrier</span></a></li><li> <a href="core_sync_condition.html" title="core.sync.condition"><span class="d_inlinecode donthyphenate notranslate">condition</span></a></li><li> <a href="core_sync_config.html" title="core.sync.config"><span class="d_inlinecode donthyphenate notranslate">config</span></a></li><li> <a href="core_sync_event.html" title="core.sync.event"><span class="d_inlinecode donthyphenate notranslate">event</span></a></li><li> <a href="core_sync_exception.html" title="core.sync.exception"><span class="d_inlinecode donthyphenate notranslate">exception</span></a></li><li> <a href="core_sync_mutex.html" title="core.sync.mutex"><span class="d_inlinecode donthyphenate notranslate">mutex</span></a></li><li> <a href="core_sync_rwmutex.html" title="core.sync.rwmutex"><span class="d_inlinecode donthyphenate notranslate">rwmutex</span></a></li><li> <a href="core_sync_semaphore.html" title="core.sync.semaphore"><span class="d_inlinecode donthyphenate notranslate">semaphore</span></a>
</li></ul></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">sys</span></h7><ul><li> <h7><span class="d_inlinecode donthyphenate notranslate">darwin</span></h7><ul><li> <a href="core_sys_darwin_crt_externs.html" title="core.sys.darwin.crt_externs"><span class="d_inlinecode donthyphenate notranslate">crt_externs</span></a></li><li> <a href="core_sys_darwin_ifaddrs.html" title="core.sys.darwin.ifaddrs"><span class="d_inlinecode donthyphenate notranslate">ifaddrs</span></a></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">mach</span></h7><ul><li> <a href="core_sys_darwin_mach_getsect.html" title="core.sys.darwin.mach.getsect"><span class="d_inlinecode donthyphenate notranslate">getsect</span></a></li><li> <a href="core_sys_darwin_mach_loader.html" title="core.sys.darwin.mach.loader"><span class="d_inlinecode donthyphenate notranslate">loader</span></a></li><li> <a href="core_sys_darwin_mach_nlist.html" title="core.sys.darwin.mach.nlist"><span class="d_inlinecode donthyphenate notranslate">nlist</span></a></li><li> <a href="core_sys_darwin_mach_stab.html" title="core.sys.darwin.mach.stab"><span class="d_inlinecode donthyphenate notranslate">stab</span></a></li><li> <a href="core_sys_darwin_mach_thread_act.html" title="core.sys.darwin.mach.thread_act"><span class="d_inlinecode donthyphenate notranslate">thread_act</span></a>
</li></ul></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">sys</span></h7><ul><li> <a href="core_sys_darwin_sys_sysctl.html" title="core.sys.darwin.sys.sysctl"><span class="d_inlinecode donthyphenate notranslate">sysctl</span></a>
</li></ul>
</li></ul></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">dragonflybsd</span></h7><ul><li> <h7><span class="d_inlinecode donthyphenate notranslate">sys</span></h7><ul><li> <a href="core_sys_dragonflybsd_sys_sysctl.html" title="core.sys.dragonflybsd.sys.sysctl"><span class="d_inlinecode donthyphenate notranslate">sysctl</span></a>
</li></ul>
</li></ul></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">freebsd</span></h7><ul><li> <h7><span class="d_inlinecode donthyphenate notranslate">sys</span></h7><ul><li> <a href="core_sys_freebsd_sys_sysctl.html" title="core.sys.freebsd.sys.sysctl"><span class="d_inlinecode donthyphenate notranslate">sysctl</span></a>
</li></ul>
</li></ul></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">linux</span></h7><ul><li> <a href="core_sys_linux_epoll.html" title="core.sys.linux.epoll"><span class="d_inlinecode donthyphenate notranslate">epoll</span></a></li><li> <a href="core_sys_linux_fcntl.html" title="core.sys.linux.fcntl"><span class="d_inlinecode donthyphenate notranslate">fcntl</span></a></li><li> <a href="core_sys_linux_fs.html" title="core.sys.linux.fs"><span class="d_inlinecode donthyphenate notranslate">fs</span></a></li><li> <a href="core_sys_linux_ifaddrs.html" title="core.sys.linux.ifaddrs"><span class="d_inlinecode donthyphenate notranslate">ifaddrs</span></a></li><li> <a href="core_sys_linux_io_uring.html" title="core.sys.linux.io_uring"><span class="d_inlinecode donthyphenate notranslate">io_uring</span></a></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">netinet</span></h7><ul><li> <a href="core_sys_linux_netinet_tcp.html" title="core.sys.linux.netinet.tcp"><span class="d_inlinecode donthyphenate notranslate">tcp</span></a>
</li></ul></li><li> <a href="core_sys_linux_perf_event.html" title="core.sys.linux.perf_event"><span class="d_inlinecode donthyphenate notranslate">perf_event</span></a></li><li> <a href="core_sys_linux_sched.html" title="core.sys.linux.sched"><span class="d_inlinecode donthyphenate notranslate">sched</span></a></li><li> <a href="core_sys_linux_string.html" title="core.sys.linux.string"><span class="d_inlinecode donthyphenate notranslate">string</span></a></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">sys</span></h7><ul><li> <a href="core_sys_linux_sys_eventfd.html" title="core.sys.linux.sys.eventfd"><span class="d_inlinecode donthyphenate notranslate">eventfd</span></a></li><li> <a href="core_sys_linux_sys_file.html" title="core.sys.linux.sys.file"><span class="d_inlinecode donthyphenate notranslate">file</span></a>
</li></ul></li><li> <a href="core_sys_linux_unistd.html" title="core.sys.linux.unistd"><span class="d_inlinecode donthyphenate notranslate">unistd</span></a>
</li></ul></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">netbsd</span></h7><ul><li> <h7><span class="d_inlinecode donthyphenate notranslate">sys</span></h7><ul><li> <a href="core_sys_netbsd_sys_sysctl.html" title="core.sys.netbsd.sys.sysctl"><span class="d_inlinecode donthyphenate notranslate">sysctl</span></a>
</li></ul>
</li></ul></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">openbsd</span></h7><ul><li> <h7><span class="d_inlinecode donthyphenate notranslate">sys</span></h7><ul><li> <a href="core_sys_openbsd_sys_sysctl.html" title="core.sys.openbsd.sys.sysctl"><span class="d_inlinecode donthyphenate notranslate">sysctl</span></a>
</li></ul>
</li></ul></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">posix</span></h7><ul><li> <a href="core_sys_posix_iconv.html" title="core.sys.posix.iconv"><span class="d_inlinecode donthyphenate notranslate">iconv</span></a></li><li> <a href="core_sys_posix_locale.html" title="core.sys.posix.locale"><span class="d_inlinecode donthyphenate notranslate">locale</span></a></li><li> <a href="core_sys_posix_mqueue.html" title="core.sys.posix.mqueue"><span class="d_inlinecode donthyphenate notranslate">mqueue</span></a></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">stdc</span></h7><ul><li> <a href="core_sys_posix_stdc_time.html" title="core.sys.posix.stdc.time"><span class="d_inlinecode donthyphenate notranslate">time</span></a>
</li></ul></li><li> <a href="core_sys_posix_string.html" title="core.sys.posix.string"><span class="d_inlinecode donthyphenate notranslate">string</span></a></li><li> <a href="core_sys_posix_strings.html" title="core.sys.posix.strings"><span class="d_inlinecode donthyphenate notranslate">strings</span></a></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">sys</span></h7><ul><li> <a href="core_sys_posix_sys_ioctl.html" title="core.sys.posix.sys.ioctl"><span class="d_inlinecode donthyphenate notranslate">ioctl</span></a></li><li> <a href="core_sys_posix_sys_types.html" title="core.sys.posix.sys.types"><span class="d_inlinecode donthyphenate notranslate">types</span></a>
</li></ul>
</li></ul></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">windows</span></h7><ul><li> <a href="core_sys_windows_core.html" title="core.sys.windows.core"><span class="d_inlinecode donthyphenate notranslate">core</span></a></li><li> <a href="core_sys_windows_dll.html" title="core.sys.windows.dll"><span class="d_inlinecode donthyphenate notranslate">dll</span></a></li><li> <a href="core_sys_windows_lmaccess.html" title="core.sys.windows.lmaccess"><span class="d_inlinecode donthyphenate notranslate">lmaccess</span></a></li><li> <a href="core_sys_windows_lmsvc.html" title="core.sys.windows.lmsvc"><span class="d_inlinecode donthyphenate notranslate">lmsvc</span></a></li><li> <a href="core_sys_windows_shlwapi.html" title="core.sys.windows.shlwapi"><span class="d_inlinecode donthyphenate notranslate">shlwapi</span></a></li><li> <a href="core_sys_windows_stacktrace.html" title="core.sys.windows.stacktrace"><span class="d_inlinecode donthyphenate notranslate">stacktrace</span></a></li><li> <a href="core_sys_windows_stat.html" title="core.sys.windows.stat"><span class="d_inlinecode donthyphenate notranslate">stat</span></a></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">stdc</span></h7><ul><li> <a href="core_sys_windows_stdc_time.html" title="core.sys.windows.stdc.time"><span class="d_inlinecode donthyphenate notranslate">time</span></a>
</li></ul></li><li> <a href="core_sys_windows_threadaux.html" title="core.sys.windows.threadaux"><span class="d_inlinecode donthyphenate notranslate">threadaux</span></a></li><li> <a href="core_sys_windows_vfw.html" title="core.sys.windows.vfw"><span class="d_inlinecode donthyphenate notranslate">vfw</span></a></li><li> <a href="core_sys_windows_winbase.html" title="core.sys.windows.winbase"><span class="d_inlinecode donthyphenate notranslate">winbase</span></a></li><li> <a href="core_sys_windows_winsock2.html" title="core.sys.windows.winsock2"><span class="d_inlinecode donthyphenate notranslate">winsock2</span></a>
</li></ul>
</li></ul></li><li> <a href="core_thread.html" title="core.thread"><span class="d_inlinecode donthyphenate notranslate">thread</span></a><ul><li> <a href="core_thread_context.html" title="core.thread.context"><span class="d_inlinecode donthyphenate notranslate">context</span></a></li><li> <a href="core_thread_fiber.html" title="core.thread.fiber"><span class="d_inlinecode donthyphenate notranslate">fiber</span></a><ul><li> <a href="core_thread_fiber_base.html" title="core.thread.fiber.base"><span class="d_inlinecode donthyphenate notranslate">base</span></a>
</li></ul></li><li> <a href="core_thread_osthread.html" title="core.thread.osthread"><span class="d_inlinecode donthyphenate notranslate">osthread</span></a></li><li> <a href="core_thread_threadbase.html" title="core.thread.threadbase"><span class="d_inlinecode donthyphenate notranslate">threadbase</span></a></li><li> <a href="core_thread_threadgroup.html" title="core.thread.threadgroup"><span class="d_inlinecode donthyphenate notranslate">threadgroup</span></a></li><li> <a href="core_thread_types.html" title="core.thread.types"><span class="d_inlinecode donthyphenate notranslate">types</span></a>
</li></ul></li><li> <a href="core_time.html" title="core.time"><span class="d_inlinecode donthyphenate notranslate">time</span></a></li><li> <a href="core_vararg.html" title="core.vararg"><span class="d_inlinecode donthyphenate notranslate">vararg</span></a></li><li> <a href="core_volatile.html" title="core.volatile"><span class="d_inlinecode donthyphenate notranslate">volatile</span></a>
</li></ul>
</li>
<div class="modlist-internal-separator">Internal API</div>
<li class='expand-container modlist-submenu-core'><a class='expand-toggle' href='#'><span><em class="tt">core</em></span></a>
<ul><li> <h7><span class="d_inlinecode donthyphenate notranslate">internal</span></h7><ul><li> <h7><span class="d_inlinecode donthyphenate notranslate">array</span></h7><ul><li> <a href="core_internal_array_appending.html" title="core.internal.array.appending"><span class="d_inlinecode donthyphenate notranslate">appending</span></a></li><li> <a href="core_internal_array_arrayassign.html" title="core.internal.array.arrayassign"><span class="d_inlinecode donthyphenate notranslate">arrayassign</span></a></li><li> <a href="core_internal_array_capacity.html" title="core.internal.array.capacity"><span class="d_inlinecode donthyphenate notranslate">capacity</span></a></li><li> <a href="core_internal_array_casting.html" title="core.internal.array.casting"><span class="d_inlinecode donthyphenate notranslate">casting</span></a></li><li> <a href="core_internal_array_comparison.html" title="core.internal.array.comparison"><span class="d_inlinecode donthyphenate notranslate">comparison</span></a></li><li> <a href="core_internal_array_concatenation.html" title="core.internal.array.concatenation"><span class="d_inlinecode donthyphenate notranslate">concatenation</span></a></li><li> <a href="core_internal_array_construction.html" title="core.internal.array.construction"><span class="d_inlinecode donthyphenate notranslate">construction</span></a></li><li> <a href="core_internal_array_duplication.html" title="core.internal.array.duplication"><span class="d_inlinecode donthyphenate notranslate">duplication</span></a></li><li> <a href="core_internal_array_equality.html" title="core.internal.array.equality"><span class="d_inlinecode donthyphenate notranslate">equality</span></a></li><li> <a href="core_internal_array_operations.html" title="core.internal.array.operations"><span class="d_inlinecode donthyphenate notranslate">operations</span></a></li><li> <a href="core_internal_array_utils.html" title="core.internal.array.utils"><span class="d_inlinecode donthyphenate notranslate">utils</span></a>
</li></ul></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">util</span></h7><ul><li> <a href="core_internal_util_array.html" title="core.internal.util.array"><span class="d_inlinecode donthyphenate notranslate">array</span></a></li><li> <a href="core_internal_util_math.html" title="core.internal.util.math"><span class="d_inlinecode donthyphenate notranslate">math</span></a>
</li></ul>
</li></ul>
</li></ul>
</li>
<li class='expand-container modlist-submenu-dmd'><a class='expand-toggle' href='#'><span><em class="tt">dmd</em></span></a>
<ul><li> <a href="dmd_access.html" title="dmd.access"><span class="d_inlinecode donthyphenate notranslate">access</span></a></li><li> <a href="dmd_aggregate.html" title="dmd.aggregate"><span class="d_inlinecode donthyphenate notranslate">aggregate</span></a></li><li> <a href="dmd_aliasthis.html" title="dmd.aliasthis"><span class="d_inlinecode donthyphenate notranslate">aliasthis</span></a></li><li> <a href="dmd_argtypes_aarch64.html" title="dmd.argtypes_aarch64"><span class="d_inlinecode donthyphenate notranslate">argtypes_aarch64</span></a></li><li> <a href="dmd_argtypes_sysv_x64.html" title="dmd.argtypes_sysv_x64"><span class="d_inlinecode donthyphenate notranslate">argtypes_sysv_x64</span></a></li><li> <a href="dmd_argtypes_x86.html" title="dmd.argtypes_x86"><span class="d_inlinecode donthyphenate notranslate">argtypes_x86</span></a></li><li> <a href="dmd_arrayop.html" title="dmd.arrayop"><span class="d_inlinecode donthyphenate notranslate">arrayop</span></a></li><li> <a href="dmd_arraytypes.html" title="dmd.arraytypes"><span class="d_inlinecode donthyphenate notranslate">arraytypes</span></a></li><li> <a href="dmd_ast_node.html" title="dmd.ast_node"><span class="d_inlinecode donthyphenate notranslate">ast_node</span></a></li><li> <a href="dmd_astbase.html" title="dmd.astbase"><span class="d_inlinecode donthyphenate notranslate">astbase</span></a></li><li> <a href="dmd_astcodegen.html" title="dmd.astcodegen"><span class="d_inlinecode donthyphenate notranslate">astcodegen</span></a></li><li> <a href="dmd_astenums.html" title="dmd.astenums"><span class="d_inlinecode donthyphenate notranslate">astenums</span></a></li><li> <a href="dmd_asttypename.html" title="dmd.asttypename"><span class="d_inlinecode donthyphenate notranslate">asttypename</span></a></li><li> <a href="dmd_attrib.html" title="dmd.attrib"><span class="d_inlinecode donthyphenate notranslate">attrib</span></a></li><li> <a href="dmd_attribsem.html" title="dmd.attribsem"><span class="d_inlinecode donthyphenate notranslate">attribsem</span></a></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">backend</span></h7><ul><li> <a href="dmd_backend_aarray.html" title="dmd.backend.aarray"><span class="d_inlinecode donthyphenate notranslate">aarray</span></a></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">arm</span></h7><ul><li> <a href="dmd_backend_arm_cod1.html" title="dmd.backend.arm.cod1"><span class="d_inlinecode donthyphenate notranslate">cod1</span></a></li><li> <a href="dmd_backend_arm_cod2.html" title="dmd.backend.arm.cod2"><span class="d_inlinecode donthyphenate notranslate">cod2</span></a></li><li> <a href="dmd_backend_arm_cod3.html" title="dmd.backend.arm.cod3"><span class="d_inlinecode donthyphenate notranslate">cod3</span></a></li><li> <a href="dmd_backend_arm_cod4.html" title="dmd.backend.arm.cod4"><span class="d_inlinecode donthyphenate notranslate">cod4</span></a></li><li> <a href="dmd_backend_arm_disasmarm.html" title="dmd.backend.arm.disasmarm"><span class="d_inlinecode donthyphenate notranslate">disasmarm</span></a></li><li> <a href="dmd_backend_arm_instr.html" title="dmd.backend.arm.instr"><span class="d_inlinecode donthyphenate notranslate">instr</span></a>
</li></ul></li><li> <a href="dmd_backend_backconfig.html" title="dmd.backend.backconfig"><span class="d_inlinecode donthyphenate notranslate">backconfig</span></a></li><li> <a href="dmd_backend_barray.html" title="dmd.backend.barray"><span class="d_inlinecode donthyphenate notranslate">barray</span></a></li><li> <a href="dmd_backend_bcomplex.html" title="dmd.backend.bcomplex"><span class="d_inlinecode donthyphenate notranslate">bcomplex</span></a></li><li> <a href="dmd_backend_blockopt.html" title="dmd.backend.blockopt"><span class="d_inlinecode donthyphenate notranslate">blockopt</span></a></li><li> <a href="dmd_backend_cc.html" title="dmd.backend.cc"><span class="d_inlinecode donthyphenate notranslate">cc</span></a></li><li> <a href="dmd_backend_cdef.html" title="dmd.backend.cdef"><span class="d_inlinecode donthyphenate notranslate">cdef</span></a></li><li> <a href="dmd_backend_cg.html" title="dmd.backend.cg"><span class="d_inlinecode donthyphenate notranslate">cg</span></a></li><li> <a href="dmd_backend_cgcs.html" title="dmd.backend.cgcs"><span class="d_inlinecode donthyphenate notranslate">cgcs</span></a></li><li> <a href="dmd_backend_cgcse.html" title="dmd.backend.cgcse"><span class="d_inlinecode donthyphenate notranslate">cgcse</span></a></li><li> <a href="dmd_backend_cgcv.html" title="dmd.backend.cgcv"><span class="d_inlinecode donthyphenate notranslate">cgcv</span></a></li><li> <a href="dmd_backend_cgelem.html" title="dmd.backend.cgelem"><span class="d_inlinecode donthyphenate notranslate">cgelem</span></a></li><li> <a href="dmd_backend_cgen.html" title="dmd.backend.cgen"><span class="d_inlinecode donthyphenate notranslate">cgen</span></a></li><li> <a href="dmd_backend_cgsched.html" title="dmd.backend.cgsched"><span class="d_inlinecode donthyphenate notranslate">cgsched</span></a></li><li> <a href="dmd_backend_code.html" title="dmd.backend.code"><span class="d_inlinecode donthyphenate notranslate">code</span></a></li><li> <a href="dmd_backend_codebuilder.html" title="dmd.backend.codebuilder"><span class="d_inlinecode donthyphenate notranslate">codebuilder</span></a></li><li> <a href="dmd_backend_cv4.html" title="dmd.backend.cv4"><span class="d_inlinecode donthyphenate notranslate">cv4</span></a></li><li> <a href="dmd_backend_cv8.html" title="dmd.backend.cv8"><span class="d_inlinecode donthyphenate notranslate">cv8</span></a></li><li> <a href="dmd_backend_dcgcv.html" title="dmd.backend.dcgcv"><span class="d_inlinecode donthyphenate notranslate">dcgcv</span></a></li><li> <a href="dmd_backend_dcode.html" title="dmd.backend.dcode"><span class="d_inlinecode donthyphenate notranslate">dcode</span></a></li><li> <a href="dmd_backend_debugprint.html" title="dmd.backend.debugprint"><span class="d_inlinecode donthyphenate notranslate">debugprint</span></a></li><li> <a href="dmd_backend_divcoeff.html" title="dmd.backend.divcoeff"><span class="d_inlinecode donthyphenate notranslate">divcoeff</span></a></li><li> <a href="dmd_backend_dlist.html" title="dmd.backend.dlist"><span class="d_inlinecode donthyphenate notranslate">dlist</span></a></li><li> <a href="dmd_backend_dout.html" title="dmd.backend.dout"><span class="d_inlinecode donthyphenate notranslate">dout</span></a></li><li> <a href="dmd_backend_drtlsym.html" title="dmd.backend.drtlsym"><span class="d_inlinecode donthyphenate notranslate">drtlsym</span></a></li><li> <a href="dmd_backend_dt.html" title="dmd.backend.dt"><span class="d_inlinecode donthyphenate notranslate">dt</span></a></li><li> <a href="dmd_backend_dtype.html" title="dmd.backend.dtype"><span class="d_inlinecode donthyphenate notranslate">dtype</span></a></li><li> <a href="dmd_backend_dvarstats.html" title="dmd.backend.dvarstats"><span class="d_inlinecode donthyphenate notranslate">dvarstats</span></a></li><li> <a href="dmd_backend_dvec.html" title="dmd.backend.dvec"><span class="d_inlinecode donthyphenate notranslate">dvec</span></a></li><li> <a href="dmd_backend_dwarf.html" title="dmd.backend.dwarf"><span class="d_inlinecode donthyphenate notranslate">dwarf</span></a></li><li> <a href="dmd_backend_dwarf2.html" title="dmd.backend.dwarf2"><span class="d_inlinecode donthyphenate notranslate">dwarf2</span></a></li><li> <a href="dmd_backend_dwarfdbginf.html" title="dmd.backend.dwarfdbginf"><span class="d_inlinecode donthyphenate notranslate">dwarfdbginf</span></a></li><li> <a href="dmd_backend_dwarfeh.html" title="dmd.backend.dwarfeh"><span class="d_inlinecode donthyphenate notranslate">dwarfeh</span></a></li><li> <a href="dmd_backend_ee.html" title="dmd.backend.ee"><span class="d_inlinecode donthyphenate notranslate">ee</span></a></li><li> <a href="dmd_backend_eh.html" title="dmd.backend.eh"><span class="d_inlinecode donthyphenate notranslate">eh</span></a></li><li> <a href="dmd_backend_el.html" title="dmd.backend.el"><span class="d_inlinecode donthyphenate notranslate">el</span></a></li><li> <a href="dmd_backend_elem.html" title="dmd.backend.elem"><span class="d_inlinecode donthyphenate notranslate">elem</span></a></li><li> <a href="dmd_backend_elfobj.html" title="dmd.backend.elfobj"><span class="d_inlinecode donthyphenate notranslate">elfobj</span></a></li><li> <a href="dmd_backend_elpicpie.html" title="dmd.backend.elpicpie"><span class="d_inlinecode donthyphenate notranslate">elpicpie</span></a></li><li> <a href="dmd_backend_evalu8.html" title="dmd.backend.evalu8"><span class="d_inlinecode donthyphenate notranslate">evalu8</span></a></li><li> <a href="dmd_backend_fp.html" title="dmd.backend.fp"><span class="d_inlinecode donthyphenate notranslate">fp</span></a></li><li> <a href="dmd_backend_gdag.html" title="dmd.backend.gdag"><span class="d_inlinecode donthyphenate notranslate">gdag</span></a></li><li> <a href="dmd_backend_gflow.html" title="dmd.backend.gflow"><span class="d_inlinecode donthyphenate notranslate">gflow</span></a></li><li> <a href="dmd_backend_global.html" title="dmd.backend.global"><span class="d_inlinecode donthyphenate notranslate">global</span></a></li><li> <a href="dmd_backend_glocal.html" title="dmd.backend.glocal"><span class="d_inlinecode donthyphenate notranslate">glocal</span></a></li><li> <a href="dmd_backend_gloop.html" title="dmd.backend.gloop"><span class="d_inlinecode donthyphenate notranslate">gloop</span></a></li><li> <a href="dmd_backend_go.html" title="dmd.backend.go"><span class="d_inlinecode donthyphenate notranslate">go</span></a></li><li> <a href="dmd_backend_goh.html" title="dmd.backend.goh"><span class="d_inlinecode donthyphenate notranslate">goh</span></a></li><li> <a href="dmd_backend_gother.html" title="dmd.backend.gother"><span class="d_inlinecode donthyphenate notranslate">gother</span></a></li><li> <a href="dmd_backend_gsroa.html" title="dmd.backend.gsroa"><span class="d_inlinecode donthyphenate notranslate">gsroa</span></a></li><li> <a href="dmd_backend_iasm.html" title="dmd.backend.iasm"><span class="d_inlinecode donthyphenate notranslate">iasm</span></a></li><li> <a href="dmd_backend_inliner.html" title="dmd.backend.inliner"><span class="d_inlinecode donthyphenate notranslate">inliner</span></a></li><li> <a href="dmd_backend_mach.html" title="dmd.backend.mach"><span class="d_inlinecode donthyphenate notranslate">mach</span></a></li><li> <a href="dmd_backend_machobj.html" title="dmd.backend.machobj"><span class="d_inlinecode donthyphenate notranslate">machobj</span></a></li><li> <a href="dmd_backend_melf.html" title="dmd.backend.melf"><span class="d_inlinecode donthyphenate notranslate">melf</span></a></li><li> <a href="dmd_backend_mem.html" title="dmd.backend.mem"><span class="d_inlinecode donthyphenate notranslate">mem</span></a></li><li> <a href="dmd_backend_mscoff.html" title="dmd.backend.mscoff"><span class="d_inlinecode donthyphenate notranslate">mscoff</span></a></li><li> <a href="dmd_backend_mscoffobj.html" title="dmd.backend.mscoffobj"><span class="d_inlinecode donthyphenate notranslate">mscoffobj</span></a></li><li> <a href="dmd_backend_obj.html" title="dmd.backend.obj"><span class="d_inlinecode donthyphenate notranslate">obj</span></a></li><li> <a href="dmd_backend_oper.html" title="dmd.backend.oper"><span class="d_inlinecode donthyphenate notranslate">oper</span></a></li><li> <a href="dmd_backend_pdata.html" title="dmd.backend.pdata"><span class="d_inlinecode donthyphenate notranslate">pdata</span></a></li><li> <a href="dmd_backend_ptrntab.html" title="dmd.backend.ptrntab"><span class="d_inlinecode donthyphenate notranslate">ptrntab</span></a></li><li> <a href="dmd_backend_rtlsym.html" title="dmd.backend.rtlsym"><span class="d_inlinecode donthyphenate notranslate">rtlsym</span></a></li><li> <a href="dmd_backend_symbol.html" title="dmd.backend.symbol"><span class="d_inlinecode donthyphenate notranslate">symbol</span></a></li><li> <a href="dmd_backend_symtab.html" title="dmd.backend.symtab"><span class="d_inlinecode donthyphenate notranslate">symtab</span></a></li><li> <a href="dmd_backend_ty.html" title="dmd.backend.ty"><span class="d_inlinecode donthyphenate notranslate">ty</span></a></li><li> <a href="dmd_backend_type.html" title="dmd.backend.type"><span class="d_inlinecode donthyphenate notranslate">type</span></a></li><li> <a href="dmd_backend_util2.html" title="dmd.backend.util2"><span class="d_inlinecode donthyphenate notranslate">util2</span></a></li><li> <a href="dmd_backend_var.html" title="dmd.backend.var"><span class="d_inlinecode donthyphenate notranslate">var</span></a></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">x86</span></h7><ul><li> <a href="dmd_backend_x86_cg87.html" title="dmd.backend.x86.cg87"><span class="d_inlinecode donthyphenate notranslate">cg87</span></a></li><li> <a href="dmd_backend_x86_cgcod.html" title="dmd.backend.x86.cgcod"><span class="d_inlinecode donthyphenate notranslate">cgcod</span></a></li><li> <a href="dmd_backend_x86_cgreg.html" title="dmd.backend.x86.cgreg"><span class="d_inlinecode donthyphenate notranslate">cgreg</span></a></li><li> <a href="dmd_backend_x86_cgxmm.html" title="dmd.backend.x86.cgxmm"><span class="d_inlinecode donthyphenate notranslate">cgxmm</span></a></li><li> <a href="dmd_backend_x86_cod1.html" title="dmd.backend.x86.cod1"><span class="d_inlinecode donthyphenate notranslate">cod1</span></a></li><li> <a href="dmd_backend_x86_cod2.html" title="dmd.backend.x86.cod2"><span class="d_inlinecode donthyphenate notranslate">cod2</span></a></li><li> <a href="dmd_backend_x86_cod3.html" title="dmd.backend.x86.cod3"><span class="d_inlinecode donthyphenate notranslate">cod3</span></a></li><li> <a href="dmd_backend_x86_cod4.html" title="dmd.backend.x86.cod4"><span class="d_inlinecode donthyphenate notranslate">cod4</span></a></li><li> <a href="dmd_backend_x86_cod5.html" title="dmd.backend.x86.cod5"><span class="d_inlinecode donthyphenate notranslate">cod5</span></a></li><li> <a href="dmd_backend_x86_code_x86.html" title="dmd.backend.x86.code_x86"><span class="d_inlinecode donthyphenate notranslate">code_x86</span></a></li><li> <a href="dmd_backend_x86_disasm86.html" title="dmd.backend.x86.disasm86"><span class="d_inlinecode donthyphenate notranslate">disasm86</span></a></li><li> <a href="dmd_backend_x86_nteh.html" title="dmd.backend.x86.nteh"><span class="d_inlinecode donthyphenate notranslate">nteh</span></a></li><li> <a href="dmd_backend_x86_xmm.html" title="dmd.backend.x86.xmm"><span class="d_inlinecode donthyphenate notranslate">xmm</span></a>
</li></ul>
</li></ul></li><li> <a href="dmd_blockexit.html" title="dmd.blockexit"><span class="d_inlinecode donthyphenate notranslate">blockexit</span></a></li><li> <a href="dmd_builtin.html" title="dmd.builtin"><span class="d_inlinecode donthyphenate notranslate">builtin</span></a></li><li> <a href="dmd_canthrow.html" title="dmd.canthrow"><span class="d_inlinecode donthyphenate notranslate">canthrow</span></a></li><li> <a href="dmd_chkformat.html" title="dmd.chkformat"><span class="d_inlinecode donthyphenate notranslate">chkformat</span></a></li><li> <a href="dmd_cli.html" title="dmd.cli"><span class="d_inlinecode donthyphenate notranslate">cli</span></a></li><li> <a href="dmd_clone.html" title="dmd.clone"><span class="d_inlinecode donthyphenate notranslate">clone</span></a></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">common</span></h7><ul><li> <a href="dmd_common_bitfields.html" title="dmd.common.bitfields"><span class="d_inlinecode donthyphenate notranslate">bitfields</span></a></li><li> <a href="dmd_common_blake3.html" title="dmd.common.blake3"><span class="d_inlinecode donthyphenate notranslate">blake3</span></a></li><li> <a href="dmd_common_charactertables.html" title="dmd.common.charactertables"><span class="d_inlinecode donthyphenate notranslate">charactertables</span></a></li><li> <a href="dmd_common_file.html" title="dmd.common.file"><span class="d_inlinecode donthyphenate notranslate">file</span></a></li><li> <a href="dmd_common_identifiertables.html" title="dmd.common.identifiertables"><span class="d_inlinecode donthyphenate notranslate">identifiertables</span></a></li><li> <a href="dmd_common_int128.html" title="dmd.common.int128"><span class="d_inlinecode donthyphenate notranslate">int128</span></a></li><li> <a href="dmd_common_outbuffer.html" title="dmd.common.outbuffer"><span class="d_inlinecode donthyphenate notranslate">outbuffer</span></a></li><li> <a href="dmd_common_smallbuffer.html" title="dmd.common.smallbuffer"><span class="d_inlinecode donthyphenate notranslate">smallbuffer</span></a>
</li></ul></li><li> <a href="dmd_compiler.html" title="dmd.compiler"><span class="d_inlinecode donthyphenate notranslate">compiler</span></a></li><li> <a href="dmd_cond.html" title="dmd.cond"><span class="d_inlinecode donthyphenate notranslate">cond</span></a></li><li> <a href="dmd_console.html" title="dmd.console"><span class="d_inlinecode donthyphenate notranslate">console</span></a></li><li> <a href="dmd_constfold.html" title="dmd.constfold"><span class="d_inlinecode donthyphenate notranslate">constfold</span></a></li><li> <a href="dmd_cparse.html" title="dmd.cparse"><span class="d_inlinecode donthyphenate notranslate">cparse</span></a></li><li> <a href="dmd_cpreprocess.html" title="dmd.cpreprocess"><span class="d_inlinecode donthyphenate notranslate">cpreprocess</span></a></li><li> <a href="dmd_ctfeexpr.html" title="dmd.ctfeexpr"><span class="d_inlinecode donthyphenate notranslate">ctfeexpr</span></a></li><li> <a href="dmd_ctorflow.html" title="dmd.ctorflow"><span class="d_inlinecode donthyphenate notranslate">ctorflow</span></a></li><li> <a href="dmd_cxxfrontend.html" title="dmd.cxxfrontend"><span class="d_inlinecode donthyphenate notranslate">cxxfrontend</span></a></li><li> <a href="dmd_dcast.html" title="dmd.dcast"><span class="d_inlinecode donthyphenate notranslate">dcast</span></a></li><li> <a href="dmd_dclass.html" title="dmd.dclass"><span class="d_inlinecode donthyphenate notranslate">dclass</span></a></li><li> <a href="dmd_declaration.html" title="dmd.declaration"><span class="d_inlinecode donthyphenate notranslate">declaration</span></a></li><li> <a href="dmd_delegatize.html" title="dmd.delegatize"><span class="d_inlinecode donthyphenate notranslate">delegatize</span></a></li><li> <a href="dmd_denum.html" title="dmd.denum"><span class="d_inlinecode donthyphenate notranslate">denum</span></a></li><li> <a href="dmd_deps.html" title="dmd.deps"><span class="d_inlinecode donthyphenate notranslate">deps</span></a></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">dfa</span></h7><ul><li> <a href="dmd_dfa_entry.html" title="dmd.dfa.entry"><span class="d_inlinecode donthyphenate notranslate">entry</span></a></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">fast</span></h7><ul><li> <a href="dmd_dfa_fast_analysis.html" title="dmd.dfa.fast.analysis"><span class="d_inlinecode donthyphenate notranslate">analysis</span></a></li><li> <a href="dmd_dfa_fast_expression.html" title="dmd.dfa.fast.expression"><span class="d_inlinecode donthyphenate notranslate">expression</span></a></li><li> <a href="dmd_dfa_fast_report.html" title="dmd.dfa.fast.report"><span class="d_inlinecode donthyphenate notranslate">report</span></a></li><li> <a href="dmd_dfa_fast_statement.html" title="dmd.dfa.fast.statement"><span class="d_inlinecode donthyphenate notranslate">statement</span></a></li><li> <a href="dmd_dfa_fast_structure.html" title="dmd.dfa.fast.structure"><span class="d_inlinecode donthyphenate notranslate">structure</span></a>
</li></ul></li><li> <a href="dmd_dfa_utils.html" title="dmd.dfa.utils"><span class="d_inlinecode donthyphenate notranslate">utils</span></a>
</li></ul></li><li> <a href="dmd_dimport.html" title="dmd.dimport"><span class="d_inlinecode donthyphenate notranslate">dimport</span></a></li><li> <a href="dmd_dinifile.html" title="dmd.dinifile"><span class="d_inlinecode donthyphenate notranslate">dinifile</span></a></li><li> <a href="dmd_dinterpret.html" title="dmd.dinterpret"><span class="d_inlinecode donthyphenate notranslate">dinterpret</span></a></li><li> <a href="dmd_dmacro.html" title="dmd.dmacro"><span class="d_inlinecode donthyphenate notranslate">dmacro</span></a></li><li> <a href="dmd_dmdparams.html" title="dmd.dmdparams"><span class="d_inlinecode donthyphenate notranslate">dmdparams</span></a></li><li> <a href="dmd_dmodule.html" title="dmd.dmodule"><span class="d_inlinecode donthyphenate notranslate">dmodule</span></a></li><li> <a href="dmd_dmsc.html" title="dmd.dmsc"><span class="d_inlinecode donthyphenate notranslate">dmsc</span></a></li><li> <a href="dmd_doc.html" title="dmd.doc"><span class="d_inlinecode donthyphenate notranslate">doc</span></a></li><li> <a href="dmd_dscope.html" title="dmd.dscope"><span class="d_inlinecode donthyphenate notranslate">dscope</span></a></li><li> <a href="dmd_dstruct.html" title="dmd.dstruct"><span class="d_inlinecode donthyphenate notranslate">dstruct</span></a></li><li> <a href="dmd_dsymbol.html" title="dmd.dsymbol"><span class="d_inlinecode donthyphenate notranslate">dsymbol</span></a></li><li> <a href="dmd_dsymbolsem.html" title="dmd.dsymbolsem"><span class="d_inlinecode donthyphenate notranslate">dsymbolsem</span></a></li><li> <a href="dmd_dtemplate.html" title="dmd.dtemplate"><span class="d_inlinecode donthyphenate notranslate">dtemplate</span></a></li><li> <a href="dmd_dtoh.html" title="dmd.dtoh"><span class="d_inlinecode donthyphenate notranslate">dtoh</span></a></li><li> <a href="dmd_dversion.html" title="dmd.dversion"><span class="d_inlinecode donthyphenate notranslate">dversion</span></a></li><li> <a href="dmd_entity.html" title="dmd.entity"><span class="d_inlinecode donthyphenate notranslate">entity</span></a></li><li> <a href="dmd_enumsem.html" title="dmd.enumsem"><span class="d_inlinecode donthyphenate notranslate">enumsem</span></a></li><li> <a href="dmd_errors.html" title="dmd.errors"><span class="d_inlinecode donthyphenate notranslate">errors</span></a></li><li> <a href="dmd_errorsink.html" title="dmd.errorsink"><span class="d_inlinecode donthyphenate notranslate">errorsink</span></a></li><li> <a href="dmd_escape.html" title="dmd.escape"><span class="d_inlinecode donthyphenate notranslate">escape</span></a></li><li> <a href="dmd_expression.html" title="dmd.expression"><span class="d_inlinecode donthyphenate notranslate">expression</span></a></li><li> <a href="dmd_expressionsem.html" title="dmd.expressionsem"><span class="d_inlinecode donthyphenate notranslate">expressionsem</span></a></li><li> <a href="dmd_file_manager.html" title="dmd.file_manager"><span class="d_inlinecode donthyphenate notranslate">file_manager</span></a></li><li> <a href="dmd_frontend.html" title="dmd.frontend"><span class="d_inlinecode donthyphenate notranslate">frontend</span></a></li><li> <a href="dmd_func.html" title="dmd.func"><span class="d_inlinecode donthyphenate notranslate">func</span></a></li><li> <a href="dmd_funcsem.html" title="dmd.funcsem"><span class="d_inlinecode donthyphenate notranslate">funcsem</span></a></li><li> <a href="dmd_globals.html" title="dmd.globals"><span class="d_inlinecode donthyphenate notranslate">globals</span></a></li><li> <a href="dmd_glue.html" title="dmd.glue"><span class="d_inlinecode donthyphenate notranslate">glue</span></a><ul><li> <a href="dmd_glue_e2ir.html" title="dmd.glue.e2ir"><span class="d_inlinecode donthyphenate notranslate">e2ir</span></a></li><li> <a href="dmd_glue_objc.html" title="dmd.glue.objc"><span class="d_inlinecode donthyphenate notranslate">objc</span></a></li><li> <a href="dmd_glue_s2ir.html" title="dmd.glue.s2ir"><span class="d_inlinecode donthyphenate notranslate">s2ir</span></a></li><li> <a href="dmd_glue_tocsym.html" title="dmd.glue.tocsym"><span class="d_inlinecode donthyphenate notranslate">tocsym</span></a></li><li> <a href="dmd_glue_toctype.html" title="dmd.glue.toctype"><span class="d_inlinecode donthyphenate notranslate">toctype</span></a></li><li> <a href="dmd_glue_tocvdebug.html" title="dmd.glue.tocvdebug"><span class="d_inlinecode donthyphenate notranslate">tocvdebug</span></a></li><li> <a href="dmd_glue_todt.html" title="dmd.glue.todt"><span class="d_inlinecode donthyphenate notranslate">todt</span></a></li><li> <a href="dmd_glue_toir.html" title="dmd.glue.toir"><span class="d_inlinecode donthyphenate notranslate">toir</span></a></li><li> <a href="dmd_glue_toobj.html" title="dmd.glue.toobj"><span class="d_inlinecode donthyphenate notranslate">toobj</span></a>
</li></ul></li><li> <a href="dmd_hdrgen.html" title="dmd.hdrgen"><span class="d_inlinecode donthyphenate notranslate">hdrgen</span></a></li><li> <a href="dmd_iasm.html" title="dmd.iasm"><span class="d_inlinecode donthyphenate notranslate">iasm</span></a><ul><li> <a href="dmd_iasm_dmdaarch64.html" title="dmd.iasm.dmdaarch64"><span class="d_inlinecode donthyphenate notranslate">dmdaarch64</span></a></li><li> <a href="dmd_iasm_dmdx86.html" title="dmd.iasm.dmdx86"><span class="d_inlinecode donthyphenate notranslate">dmdx86</span></a></li><li> <a href="dmd_iasm_gcc.html" title="dmd.iasm.gcc"><span class="d_inlinecode donthyphenate notranslate">gcc</span></a>
</li></ul></li><li> <a href="dmd_id.html" title="dmd.id"><span class="d_inlinecode donthyphenate notranslate">id</span></a></li><li> <a href="dmd_identifier.html" title="dmd.identifier"><span class="d_inlinecode donthyphenate notranslate">identifier</span></a></li><li> <a href="dmd_impcnvtab.html" title="dmd.impcnvtab"><span class="d_inlinecode donthyphenate notranslate">impcnvtab</span></a></li><li> <a href="dmd_imphint.html" title="dmd.imphint"><span class="d_inlinecode donthyphenate notranslate">imphint</span></a></li><li> <a href="dmd_importc.html" title="dmd.importc"><span class="d_inlinecode donthyphenate notranslate">importc</span></a></li><li> <a href="dmd_init.html" title="dmd.init"><span class="d_inlinecode donthyphenate notranslate">init</span></a></li><li> <a href="dmd_initsem.html" title="dmd.initsem"><span class="d_inlinecode donthyphenate notranslate">initsem</span></a></li><li> <a href="dmd_inline.html" title="dmd.inline"><span class="d_inlinecode donthyphenate notranslate">inline</span></a></li><li> <a href="dmd_inlinecost.html" title="dmd.inlinecost"><span class="d_inlinecode donthyphenate notranslate">inlinecost</span></a></li><li> <a href="dmd_intrange.html" title="dmd.intrange"><span class="d_inlinecode donthyphenate notranslate">intrange</span></a></li><li> <a href="dmd_json.html" title="dmd.json"><span class="d_inlinecode donthyphenate notranslate">json</span></a></li><li> <a href="dmd_lambdacomp.html" title="dmd.lambdacomp"><span class="d_inlinecode donthyphenate notranslate">lambdacomp</span></a></li><li> <a href="dmd_lexer.html" title="dmd.lexer"><span class="d_inlinecode donthyphenate notranslate">lexer</span></a></li><li> <a href="dmd_lib.html" title="dmd.lib"><span class="d_inlinecode donthyphenate notranslate">lib</span></a><ul><li> <a href="dmd_lib_elf.html" title="dmd.lib.elf"><span class="d_inlinecode donthyphenate notranslate">elf</span></a></li><li> <a href="dmd_lib_mach.html" title="dmd.lib.mach"><span class="d_inlinecode donthyphenate notranslate">mach</span></a></li><li> <a href="dmd_lib_mscoff.html" title="dmd.lib.mscoff"><span class="d_inlinecode donthyphenate notranslate">mscoff</span></a></li><li> <a href="dmd_lib_scanelf.html" title="dmd.lib.scanelf"><span class="d_inlinecode donthyphenate notranslate">scanelf</span></a></li><li> <a href="dmd_lib_scanmach.html" title="dmd.lib.scanmach"><span class="d_inlinecode donthyphenate notranslate">scanmach</span></a></li><li> <a href="dmd_lib_scanmscoff.html" title="dmd.lib.scanmscoff"><span class="d_inlinecode donthyphenate notranslate">scanmscoff</span></a>
</li></ul></li><li> <a href="dmd_link.html" title="dmd.link"><span class="d_inlinecode donthyphenate notranslate">link</span></a></li><li> <a href="dmd_location.html" title="dmd.location"><span class="d_inlinecode donthyphenate notranslate">location</span></a></li><li> <a href="dmd_main.html" title="dmd.main"><span class="d_inlinecode donthyphenate notranslate">main</span></a></li><li> <a href="dmd_mangle.html" title="dmd.mangle"><span class="d_inlinecode donthyphenate notranslate">mangle</span></a><ul><li> <a href="dmd_mangle_basic.html" title="dmd.mangle.basic"><span class="d_inlinecode donthyphenate notranslate">basic</span></a></li><li> <a href="dmd_mangle_cpp.html" title="dmd.mangle.cpp"><span class="d_inlinecode donthyphenate notranslate">cpp</span></a></li><li> <a href="dmd_mangle_cppwin.html" title="dmd.mangle.cppwin"><span class="d_inlinecode donthyphenate notranslate">cppwin</span></a>
</li></ul></li><li> <a href="dmd_mars.html" title="dmd.mars"><span class="d_inlinecode donthyphenate notranslate">mars</span></a></li><li> <a href="dmd_mtype.html" title="dmd.mtype"><span class="d_inlinecode donthyphenate notranslate">mtype</span></a></li><li> <a href="dmd_mustuse.html" title="dmd.mustuse"><span class="d_inlinecode donthyphenate notranslate">mustuse</span></a></li><li> <a href="dmd_nogc.html" title="dmd.nogc"><span class="d_inlinecode donthyphenate notranslate">nogc</span></a></li><li> <a href="dmd_nspace.html" title="dmd.nspace"><span class="d_inlinecode donthyphenate notranslate">nspace</span></a></li><li> <a href="dmd_ob.html" title="dmd.ob"><span class="d_inlinecode donthyphenate notranslate">ob</span></a></li><li> <a href="dmd_objc.html" title="dmd.objc"><span class="d_inlinecode donthyphenate notranslate">objc</span></a></li><li> <a href="dmd_opover.html" title="dmd.opover"><span class="d_inlinecode donthyphenate notranslate">opover</span></a></li><li> <a href="dmd_optimize.html" title="dmd.optimize"><span class="d_inlinecode donthyphenate notranslate">optimize</span></a></li><li> <a href="dmd_parse.html" title="dmd.parse"><span class="d_inlinecode donthyphenate notranslate">parse</span></a></li><li> <a href="dmd_pragmasem.html" title="dmd.pragmasem"><span class="d_inlinecode donthyphenate notranslate">pragmasem</span></a></li><li> <a href="dmd_printast.html" title="dmd.printast"><span class="d_inlinecode donthyphenate notranslate">printast</span></a></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">root</span></h7><ul><li> <a href="dmd_root_aav.html" title="dmd.root.aav"><span class="d_inlinecode donthyphenate notranslate">aav</span></a></li><li> <a href="dmd_root_array.html" title="dmd.root.array"><span class="d_inlinecode donthyphenate notranslate">array</span></a></li><li> <a href="dmd_root_bitarray.html" title="dmd.root.bitarray"><span class="d_inlinecode donthyphenate notranslate">bitarray</span></a></li><li> <a href="dmd_root_complex.html" title="dmd.root.complex"><span class="d_inlinecode donthyphenate notranslate">complex</span></a></li><li> <a href="dmd_root_ctfloat.html" title="dmd.root.ctfloat"><span class="d_inlinecode donthyphenate notranslate">ctfloat</span></a></li><li> <a href="dmd_root_env.html" title="dmd.root.env"><span class="d_inlinecode donthyphenate notranslate">env</span></a></li><li> <a href="dmd_root_file.html" title="dmd.root.file"><span class="d_inlinecode donthyphenate notranslate">file</span></a></li><li> <a href="dmd_root_filename.html" title="dmd.root.filename"><span class="d_inlinecode donthyphenate notranslate">filename</span></a></li><li> <a href="dmd_root_hash.html" title="dmd.root.hash"><span class="d_inlinecode donthyphenate notranslate">hash</span></a></li><li> <a href="dmd_root_longdouble.html" title="dmd.root.longdouble"><span class="d_inlinecode donthyphenate notranslate">longdouble</span></a></li><li> <a href="dmd_root_man.html" title="dmd.root.man"><span class="d_inlinecode donthyphenate notranslate">man</span></a></li><li> <a href="dmd_root_optional.html" title="dmd.root.optional"><span class="d_inlinecode donthyphenate notranslate">optional</span></a></li><li> <a href="dmd_root_port.html" title="dmd.root.port"><span class="d_inlinecode donthyphenate notranslate">port</span></a></li><li> <a href="dmd_root_region.html" title="dmd.root.region"><span class="d_inlinecode donthyphenate notranslate">region</span></a></li><li> <a href="dmd_root_response.html" title="dmd.root.response"><span class="d_inlinecode donthyphenate notranslate">response</span></a></li><li> <a href="dmd_root_rmem.html" title="dmd.root.rmem"><span class="d_inlinecode donthyphenate notranslate">rmem</span></a></li><li> <a href="dmd_root_speller.html" title="dmd.root.speller"><span class="d_inlinecode donthyphenate notranslate">speller</span></a></li><li> <a href="dmd_root_string.html" title="dmd.root.string"><span class="d_inlinecode donthyphenate notranslate">string</span></a></li><li> <a href="dmd_root_stringtable.html" title="dmd.root.stringtable"><span class="d_inlinecode donthyphenate notranslate">stringtable</span></a></li><li> <a href="dmd_root_strtold.html" title="dmd.root.strtold"><span class="d_inlinecode donthyphenate notranslate">strtold</span></a></li><li> <a href="dmd_root_utf.html" title="dmd.root.utf"><span class="d_inlinecode donthyphenate notranslate">utf</span></a>
</li></ul></li><li> <a href="dmd_rootobject.html" title="dmd.rootobject"><span class="d_inlinecode donthyphenate notranslate">rootobject</span></a></li><li> <a href="dmd_safe.html" title="dmd.safe"><span class="d_inlinecode donthyphenate notranslate">safe</span></a></li><li> <a href="dmd_sarif.html" title="dmd.sarif"><span class="d_inlinecode donthyphenate notranslate">sarif</span></a></li><li> <a href="dmd_semantic2.html" title="dmd.semantic2"><span class="d_inlinecode donthyphenate notranslate">semantic2</span></a></li><li> <a href="dmd_semantic3.html" title="dmd.semantic3"><span class="d_inlinecode donthyphenate notranslate">semantic3</span></a></li><li> <a href="dmd_sideeffect.html" title="dmd.sideeffect"><span class="d_inlinecode donthyphenate notranslate">sideeffect</span></a></li><li> <a href="dmd_statement.html" title="dmd.statement"><span class="d_inlinecode donthyphenate notranslate">statement</span></a></li><li> <a href="dmd_statementsem.html" title="dmd.statementsem"><span class="d_inlinecode donthyphenate notranslate">statementsem</span></a></li><li> <a href="dmd_staticassert.html" title="dmd.staticassert"><span class="d_inlinecode donthyphenate notranslate">staticassert</span></a></li><li> <a href="dmd_staticcond.html" title="dmd.staticcond"><span class="d_inlinecode donthyphenate notranslate">staticcond</span></a></li><li> <a href="dmd_stmtstate.html" title="dmd.stmtstate"><span class="d_inlinecode donthyphenate notranslate">stmtstate</span></a></li><li> <a href="dmd_target.html" title="dmd.target"><span class="d_inlinecode donthyphenate notranslate">target</span></a></li><li> <a href="dmd_targetcompiler.html" title="dmd.targetcompiler"><span class="d_inlinecode donthyphenate notranslate">targetcompiler</span></a></li><li> <a href="dmd_templateparamsem.html" title="dmd.templateparamsem"><span class="d_inlinecode donthyphenate notranslate">templateparamsem</span></a></li><li> <a href="dmd_templatesem.html" title="dmd.templatesem"><span class="d_inlinecode donthyphenate notranslate">templatesem</span></a></li><li> <a href="dmd_timetrace.html" title="dmd.timetrace"><span class="d_inlinecode donthyphenate notranslate">timetrace</span></a></li><li> <a href="dmd_tokens.html" title="dmd.tokens"><span class="d_inlinecode donthyphenate notranslate">tokens</span></a></li><li> <a href="dmd_traits.html" title="dmd.traits"><span class="d_inlinecode donthyphenate notranslate">traits</span></a></li><li> <a href="dmd_typesem.html" title="dmd.typesem"><span class="d_inlinecode donthyphenate notranslate">typesem</span></a></li><li> <a href="dmd_typinf.html" title="dmd.typinf"><span class="d_inlinecode donthyphenate notranslate">typinf</span></a></li><li> <a href="dmd_utils.html" title="dmd.utils"><span class="d_inlinecode donthyphenate notranslate">utils</span></a></li><li> <a href="dmd_visitor.html" title="dmd.visitor"><span class="d_inlinecode donthyphenate notranslate">visitor</span></a><ul><li> <a href="dmd_visitor_foreachvar.html" title="dmd.visitor.foreachvar"><span class="d_inlinecode donthyphenate notranslate">foreachvar</span></a></li><li> <a href="dmd_visitor_parsetime.html" title="dmd.visitor.parsetime"><span class="d_inlinecode donthyphenate notranslate">parsetime</span></a></li><li> <a href="dmd_visitor_permissive.html" title="dmd.visitor.permissive"><span class="d_inlinecode donthyphenate notranslate">permissive</span></a></li><li> <a href="dmd_visitor_postorder.html" title="dmd.visitor.postorder"><span class="d_inlinecode donthyphenate notranslate">postorder</span></a></li><li> <a href="dmd_visitor_statement_rewrite_walker.html" title="dmd.visitor.statement_rewrite_walker"><span class="d_inlinecode donthyphenate notranslate">statement_rewrite_walker</span></a></li><li> <a href="dmd_visitor_strict.html" title="dmd.visitor.strict"><span class="d_inlinecode donthyphenate notranslate">strict</span></a></li><li> <a href="dmd_visitor_transitive.html" title="dmd.visitor.transitive"><span class="d_inlinecode donthyphenate notranslate">transitive</span></a>
</li></ul></li><li> <a href="dmd_vsoptions.html" title="dmd.vsoptions"><span class="d_inlinecode donthyphenate notranslate">vsoptions</span></a>
</li></ul>
</li>
<li class='expand-container modlist-submenu-rt'><a class='expand-toggle' href='#'><span><em class="tt">rt</em></span></a>
<ul><li> <a href="rt_aApply.html" title="rt.aApply"><span class="d_inlinecode donthyphenate notranslate">aApply</span></a></li><li> <a href="rt_aApplyR.html" title="rt.aApplyR"><span class="d_inlinecode donthyphenate notranslate">aApplyR</span></a></li><li> <a href="rt_alloca.html" title="rt.alloca"><span class="d_inlinecode donthyphenate notranslate">alloca</span></a></li><li> <a href="rt_arraycat.html" title="rt.arraycat"><span class="d_inlinecode donthyphenate notranslate">arraycat</span></a></li><li> <a href="rt_cmath2.html" title="rt.cmath2"><span class="d_inlinecode donthyphenate notranslate">cmath2</span></a></li><li> <a href="rt_config.html" title="rt.config"><span class="d_inlinecode donthyphenate notranslate">config</span></a></li><li> <a href="rt_cover.html" title="rt.cover"><span class="d_inlinecode donthyphenate notranslate">cover</span></a></li><li> <a href="rt_critical_.html" title="rt.critical_"><span class="d_inlinecode donthyphenate notranslate">critical_</span></a></li><li> <a href="rt_deh.html" title="rt.deh"><span class="d_inlinecode donthyphenate notranslate">deh</span></a></li><li> <a href="rt_deh_win32.html" title="rt.deh_win32"><span class="d_inlinecode donthyphenate notranslate">deh_win32</span></a></li><li> <a href="rt_deh_win64_posix.html" title="rt.deh_win64_posix"><span class="d_inlinecode donthyphenate notranslate">deh_win64_posix</span></a></li><li> <a href="rt_dmain2.html" title="rt.dmain2"><span class="d_inlinecode donthyphenate notranslate">dmain2</span></a></li><li> <a href="rt_dwarfeh.html" title="rt.dwarfeh"><span class="d_inlinecode donthyphenate notranslate">dwarfeh</span></a></li><li> <a href="rt_ehalloc.html" title="rt.ehalloc"><span class="d_inlinecode donthyphenate notranslate">ehalloc</span></a></li><li> <a href="rt_invariant_.html" title="rt.invariant_"><span class="d_inlinecode donthyphenate notranslate">invariant_</span></a></li><li> <a href="rt_lifetime.html" title="rt.lifetime"><span class="d_inlinecode donthyphenate notranslate">lifetime</span></a></li><li> <a href="rt_llmath.html" title="rt.llmath"><span class="d_inlinecode donthyphenate notranslate">llmath</span></a></li><li> <a href="rt_memory.html" title="rt.memory"><span class="d_inlinecode donthyphenate notranslate">memory</span></a></li><li> <a href="rt_memset.html" title="rt.memset"><span class="d_inlinecode donthyphenate notranslate">memset</span></a></li><li> <a href="rt_minfo.html" title="rt.minfo"><span class="d_inlinecode donthyphenate notranslate">minfo</span></a></li><li> <a href="rt_monitor_.html" title="rt.monitor_"><span class="d_inlinecode donthyphenate notranslate">monitor_</span></a></li><li> <a href="rt_msvc.html" title="rt.msvc"><span class="d_inlinecode donthyphenate notranslate">msvc</span></a></li><li> <a href="rt_msvc_math.html" title="rt.msvc_math"><span class="d_inlinecode donthyphenate notranslate">msvc_math</span></a></li><li> <a href="rt_profilegc.html" title="rt.profilegc"><span class="d_inlinecode donthyphenate notranslate">profilegc</span></a></li><li> <a href="rt_sections.html" title="rt.sections"><span class="d_inlinecode donthyphenate notranslate">sections</span></a></li><li> <a href="rt_sections_darwin_64.html" title="rt.sections_darwin_64"><span class="d_inlinecode donthyphenate notranslate">sections_darwin_64</span></a></li><li> <a href="rt_sections_elf_shared.html" title="rt.sections_elf_shared"><span class="d_inlinecode donthyphenate notranslate">sections_elf_shared</span></a></li><li> <a href="rt_sections_osx_64.html" title="rt.sections_osx_64"><span class="d_inlinecode donthyphenate notranslate">sections_osx_64</span></a></li><li> <a href="rt_sections_osx_x86.html" title="rt.sections_osx_x86"><span class="d_inlinecode donthyphenate notranslate">sections_osx_x86</span></a></li><li> <a href="rt_sections_solaris.html" title="rt.sections_solaris"><span class="d_inlinecode donthyphenate notranslate">sections_solaris</span></a></li><li> <a href="rt_sections_win64.html" title="rt.sections_win64"><span class="d_inlinecode donthyphenate notranslate">sections_win64</span></a></li><li> <a href="rt_tlsgc.html" title="rt.tlsgc"><span class="d_inlinecode donthyphenate notranslate">tlsgc</span></a></li><li> <a href="rt_trace.html" title="rt.trace"><span class="d_inlinecode donthyphenate notranslate">trace</span></a></li><li> <a href="rt_tracegc.html" title="rt.tracegc"><span class="d_inlinecode donthyphenate notranslate">tracegc</span></a></li><li> <h7><span class="d_inlinecode donthyphenate notranslate">util</span></h7><ul><li> <a href="rt_util_typeinfo.html" title="rt.util.typeinfo"><span class="d_inlinecode donthyphenate notranslate">typeinfo</span></a></li><li> <a href="rt_util_utility.html" title="rt.util.utility"><span class="d_inlinecode donthyphenate notranslate">utility</span></a>
</li></ul>
</li></ul>
</li></ul>
</div>
<div class="hyphenate" id="content">
<div id="tools"><div > <div class="tip smallprint"> <a href="https://github.com/dlang/phobos/issues/new?title=%5Bstd.concurrency%5D%20&amp;label=Severity:Enhancement">Report a bug</a>
<div > If you spot a problem with this page, click here to create a GitHub issue.
</div>
</div>
<div class="tip smallprint"> <a href="https://github.com/dlang/phobos/edit/master/std/concurrency.d">Improve this page</a>
<div > Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
a local clone.
</div>
</div>
</div></div>
<h1><span class="d_title">std.concurrency</span></h1>
<div class="quickindex" id="quickindex"></div>
<div class="summary"><script type="text/javascript">inhibitQuickIndex = 1;</script>
<div class="quickindex"> <table class="book"><caption></caption> <tr><th scope="col">Category</th> <th scope="col">Symbols</th></tr>
<tr><td>Tid</td> <td> <a href="#.join"><em class="tt">join</em></a>&nbsp;
<a href="#.locate"><em class="tt">locate</em></a>&nbsp;
<a href="#.ownerTid"><em class="tt">ownerTid</em></a>&nbsp;
<a href="#.register"><em class="tt">register</em></a>&nbsp;
<a href="#.spawn"><em class="tt">spawn</em></a>&nbsp;
<a href="#.spawnLinked"><em class="tt">spawnLinked</em></a>&nbsp;
<a href="#.thisTid"><em class="tt">thisTid</em></a>&nbsp;
<a href="#.Tid"><em class="tt">Tid</em></a>&nbsp;
<a href="#.TidMissingException"><em class="tt">TidMissingException</em></a>&nbsp;
<a href="#.unregister"><em class="tt">unregister</em></a>&nbsp;
</td></tr>
<tr><td>Message passing</td> <td> <a href="#.prioritySend"><em class="tt">prioritySend</em></a>&nbsp;
<a href="#.receive"><em class="tt">receive</em></a>&nbsp;
<a href="#.receiveOnly"><em class="tt">receiveOnly</em></a>&nbsp;
<a href="#.receiveTimeout"><em class="tt">receiveTimeout</em></a>&nbsp;
<a href="#.send"><em class="tt">send</em></a>&nbsp;
<a href="#.setMaxMailboxSize"><em class="tt">setMaxMailboxSize</em></a>&nbsp;
</td></tr>
<tr><td>Message-related types</td> <td> <a href="#.LinkTerminated"><em class="tt">LinkTerminated</em></a>&nbsp;
<a href="#.MailboxFull"><em class="tt">MailboxFull</em></a>&nbsp;
<a href="#.MessageMismatch"><em class="tt">MessageMismatch</em></a>&nbsp;
<a href="#.OnCrowding"><em class="tt">OnCrowding</em></a>&nbsp;
<a href="#.OwnerTerminated"><em class="tt">OwnerTerminated</em></a>&nbsp;
<a href="#.PriorityMessageException"><em class="tt">PriorityMessageException</em></a>&nbsp;
</td></tr>
<tr><td>Scheduler</td> <td> <a href="#.FiberScheduler"><em class="tt">FiberScheduler</em></a>&nbsp;
<a href="#.Generator"><em class="tt">Generator</em></a>&nbsp;
<a href="#.Scheduler"><em class="tt">Scheduler</em></a>&nbsp;
<a href="#.scheduler"><em class="tt">scheduler</em></a>&nbsp;
<a href="#.ThreadInfo"><em class="tt">ThreadInfo</em></a>&nbsp;
<a href="#.ThreadScheduler"><em class="tt">ThreadScheduler</em></a>&nbsp;
<a href="#.yield"><em class="tt">yield</em></a>&nbsp;
</td></tr>
<tr><td>Misc</td> <td> <a href="#.initOnce"><em class="tt">initOnce</em></a>&nbsp;
</td></tr>
</table></div>
</div><div class="description">This is a low-level messaging API upon which more structured or restrictive
APIs may be built. The general idea is that every messageable entity is
represented by a common handle type called a <span class="d_inlinecode donthyphenate notranslate">Tid</span>, which allows messages to
be sent to logical threads that are executing in both the current process
and in external processes using the same interface. This is an important
aspect of scalability because it allows the components of a program to be
spread across available resources with few to no changes to the actual
implementation.
<div class="blankline"></div>
A logical thread is an execution context that has its own stack and which
runs asynchronously to other logical threads. These may be preemptively
scheduled kernel threads, <a href="core_thread_fiber.html">fibers</a>
(cooperative user-space threads), or some other concept with similar behavior.
<div class="blankline"></div>
The type of concurrency used when logical threads are created is determined
by the <a href="#Scheduler"><span class="d_inlinecode donthyphenate notranslate">Scheduler</span></a> selected at initialization time. The default behavior is
currently to create a new kernel thread per call to spawn, but other
schedulers are available that multiplex fibers across the main thread or
use some combination of the two approaches.
</div>
<div class="keyval License"><span class="key keyLicense">License:</span> <div class="val valLicense"><a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
</div></div>
<div class="keyval Authors"><span class="key keyAuthors">Authors:</span> <div class="val valAuthors">Sean Kelly, Alex Rønne Petersen, Martin Nowak
</div></div>
<div class="val"><p class="keyval Section"><span class="key keySection">Source</span>
<span class="phobos_src"><a class="https" href="https://github.com/dlang/phobos/blob/master/std/concurrency.d">std/concurrency.d</a></span></p></div>
<span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">__gshared</span> string received;
<span class="d_keyword">static</span> <span class="d_keyword">void</span> spawnedFunc(Tid ownerTid)
{
<span class="d_keyword">import</span> std.conv : text;
<span class="d_comment">// Receive a message from the owner thread.
</span> receive((<span class="d_keyword">int</span> i){
received = text(<span class="d_string">"Received the number "</span>, i);
<span class="d_comment">// Send a message back to the owner thread
</span> <span class="d_comment">// indicating success.
</span> send(ownerTid, <span class="d_keyword">true</span>);
});
}
<span class="d_comment">// Start spawnedFunc in a new thread.
</span><span class="d_keyword">auto</span> childTid = spawn(&amp;spawnedFunc, thisTid);
<span class="d_comment">// Send the number 42 to this new thread.
</span>send(childTid, 42);
<span class="d_comment">// Receive the result code.
</span><span class="d_keyword">auto</span> wasSuccessful = receiveOnly!(<span class="d_keyword">bool</span>);
<span class="d_keyword">assert</span>(wasSuccessful);
writeln(received); <span class="d_comment">// "Received the number 42"
</span></pre>
</div></div>
<dl><dt class="d_decl"><div ><span class="def-anchor" id=".MessageMismatch"></span><div class="quickindex" id="quickindex.MessageMismatch"></div>class <span class="def-anchor" id="MessageMismatch"></span><code class="ddoc_psymbol">MessageMismatch</code>: <span class="ddoc_psuper_symbol">object.Exception</span>;
<br></div></dt>
<dd><div class="summary">Thrown on calls to <a href="#receiveOnly"><span class="d_inlinecode donthyphenate notranslate">receiveOnly</span></a> if a message other than the type
the receiving thread expected is sent.</div>
<dl><dt class="d_decl"><div ><span class="def-anchor" id=".MessageMismatch.this"></span><div class="quickindex" id="quickindex.MessageMismatch.this"></div>pure nothrow @nogc @safe this(string <code class="ddoc_param">msg</code> = "Unexpected message type");
<br></div></dt>
<dd>
</dd>
</dl>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".OwnerTerminated"></span><div class="quickindex" id="quickindex.OwnerTerminated"></div>class <span class="def-anchor" id="OwnerTerminated"></span><code class="ddoc_psymbol">OwnerTerminated</code>: <span class="ddoc_psuper_symbol">object.Exception</span>;
<br></div></dt>
<dd><div class="summary">Thrown on calls to <a href="#receive"><span class="d_inlinecode donthyphenate notranslate">receive</span></a> if the thread that spawned the receiving
thread has terminated and no more messages exist.</div>
<dl><dt class="d_decl"><div ><span class="def-anchor" id=".OwnerTerminated.this"></span><div class="quickindex" id="quickindex.OwnerTerminated.this"></div>pure nothrow @nogc @safe this(Tid <code class="ddoc_param">t</code>, string <code class="ddoc_param">msg</code> = "Owner terminated");
<br></div></dt>
<dd>
</dd>
</dl>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".LinkTerminated"></span><div class="quickindex" id="quickindex.LinkTerminated"></div>class <span class="def-anchor" id="LinkTerminated"></span><code class="ddoc_psymbol">LinkTerminated</code>: <span class="ddoc_psuper_symbol">object.Exception</span>;
<br></div></dt>
<dd><div class="summary">Thrown if a linked thread has terminated.</div>
<dl><dt class="d_decl"><div ><span class="def-anchor" id=".LinkTerminated.this"></span><div class="quickindex" id="quickindex.LinkTerminated.this"></div>pure nothrow @nogc @safe this(Tid <code class="ddoc_param">t</code>, string <code class="ddoc_param">msg</code> = "Link terminated");
<br></div></dt>
<dd>
</dd>
</dl>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".PriorityMessageException"></span><div class="quickindex" id="quickindex.PriorityMessageException"></div>class <span class="def-anchor" id="PriorityMessageException"></span><code class="ddoc_psymbol">PriorityMessageException</code>: <span class="ddoc_psuper_symbol">object.Exception</span>;
<br></div></dt>
<dd><div class="summary">Thrown if a message was sent to a thread via
<a href="std_concurrency.html#.prioritySend"><span class="d_inlinecode donthyphenate notranslate">std.concurrency.prioritySend</span></a> and the receiver does not have a handler
for a message of this type.</div>
<dl><dt class="d_decl"><div ><span class="def-anchor" id=".PriorityMessageException.this"></span><div class="quickindex" id="quickindex.PriorityMessageException.this"></div>this(Variant <code class="ddoc_param">vals</code>);
<br></div></dt>
<dd>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".PriorityMessageException.message"></span><div class="quickindex" id="quickindex.PriorityMessageException.message"></div>Variant <span class="def-anchor" id="message"></span><code class="ddoc_psymbol">message</code>;
<br></div></dt>
<dd><div class="summary">The message that was sent.</div>
</dd>
</dl>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".MailboxFull"></span><div class="quickindex" id="quickindex.MailboxFull"></div>class <span class="def-anchor" id="MailboxFull"></span><code class="ddoc_psymbol">MailboxFull</code>: <span class="ddoc_psuper_symbol">object.Exception</span>;
<br></div></dt>
<dd><div class="summary">Thrown on mailbox crowding if the mailbox is configured with
<span class="d_inlinecode donthyphenate notranslate">OnCrowding.throwException</span>.</div>
<dl><dt class="d_decl"><div ><span class="def-anchor" id=".MailboxFull.this"></span><div class="quickindex" id="quickindex.MailboxFull.this"></div>pure nothrow @nogc @safe this(Tid <code class="ddoc_param">t</code>, string <code class="ddoc_param">msg</code> = "Mailbox full");
<br></div></dt>
<dd>
</dd>
</dl>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".TidMissingException"></span><div class="quickindex" id="quickindex.TidMissingException"></div>class <span class="def-anchor" id="TidMissingException"></span><code class="ddoc_psymbol">TidMissingException</code>: <span class="ddoc_psuper_symbol">object.Exception</span>;
<br></div></dt>
<dd><div class="summary">Thrown when a <span class="d_inlinecode donthyphenate notranslate">Tid</span> is missing, e.g. when <a href="#ownerTid"><span class="d_inlinecode donthyphenate notranslate">ownerTid</span></a> doesn't
find an owner thread.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".Tid"></span><div class="quickindex" id="quickindex.Tid"></div>struct <span class="def-anchor" id="Tid"></span><code class="ddoc_psymbol">Tid</code>;
<br></div></dt>
<dd><div class="summary">An opaque type used to represent a logical thread.</div>
<dl><dt class="d_decl"><div ><span class="def-anchor" id=".Tid.toString"></span><div class="quickindex" id="quickindex.Tid.toString"></div>void <span class="def-anchor" id="toString"></span><code class="ddoc_psymbol">toString</code><span class="template_param_list" title="Template parameter list">(W)</span>(ref W <code class="ddoc_param">w</code>) const;
<br></div></dt>
<dd><div class="summary">Generate a convenient string for identifying this <span class="d_inlinecode donthyphenate notranslate">Tid</span>. This is only
useful to see if <span class="d_inlinecode donthyphenate notranslate">Tid</span>'s that are currently executing are the same or
different, e.g. for logging and debugging. It is potentially possible
that a <span class="d_inlinecode donthyphenate notranslate">Tid</span> executed in the future will have the same <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="toString"></span><code class="ddoc_psymbol">toString</code>()</span> output
as another <span class="d_inlinecode donthyphenate notranslate">Tid</span> that has already terminated.</div>
</dd>
</dl>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".thisTid"></span><div class="quickindex" id="quickindex.thisTid"></div>@property @safe Tid <span class="def-anchor" id="thisTid"></span><code class="ddoc_psymbol">thisTid</code>();
<br></div></dt>
<dd><div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">The <span class="d_inlinecode donthyphenate notranslate">Tid</span> of the caller's thread.</div></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".ownerTid"></span><div class="quickindex" id="quickindex.ownerTid"></div>@property Tid <span class="def-anchor" id="ownerTid"></span><code class="ddoc_psymbol">ownerTid</code>();
<br></div></dt>
<dd><div class="summary">Return the <span class="d_inlinecode donthyphenate notranslate">Tid</span> of the thread which spawned the caller's thread.
</div><div class="keyval Throws"><span class="key keyThrows">Throws:</span> <div class="val valThrows">A <span class="d_inlinecode donthyphenate notranslate">TidMissingException</span> exception if
there is no owner thread.</div></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".spawn"></span><div class="quickindex" id="quickindex.spawn"></div>Tid <span class="def-anchor" id="spawn"></span><code class="ddoc_psymbol">spawn</code><span class="template_param_list" title="Template parameter list">(F, T...)</span>(F <code class="ddoc_param">fn</code>, T <code class="ddoc_param">args</code>)<br><span class="constraint">if (isSpawnable!(F, T))</span>;
<br></div></dt>
<dd><div class="summary">Starts <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">fn</code>(<code class="ddoc_param">args</code>)</span> in a new logical thread.
</div><div class="description">Executes the supplied function in a new logical thread represented by
<span class="d_inlinecode donthyphenate notranslate">Tid</span>. The calling thread is designated as the owner of the new thread.
When the owner thread terminates an <span class="d_inlinecode donthyphenate notranslate">OwnerTerminated</span> message will be
sent to the new thread, causing an <span class="d_inlinecode donthyphenate notranslate">OwnerTerminated</span> exception to be
thrown on <span class="d_inlinecode donthyphenate notranslate">receive()</span>.
</div>
<div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">F <code class="ddoc_param">fn</code></td>
<td class="param_desc">The function to execute.</td></tr>
<tr class="param"><td class="param_id">T <code class="ddoc_param">args</code></td>
<td class="param_desc">Arguments to the function.</td></tr>
</table></div></div>
<div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">A <span class="d_inlinecode donthyphenate notranslate">Tid</span> representing the new logical thread.
</div></div>
<div class="val"><p class="keyval Section"><span class="key keySection">Notes</span>
<span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">args</code></span> must not have unshared aliasing. In other words, all arguments
to <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">fn</code></span> must either be <span class="d_inlinecode donthyphenate notranslate">shared</span> or <span class="d_inlinecode donthyphenate notranslate">immutable</span> or have no
pointer indirection. This is necessary for enforcing isolation among
threads.
<div class="blankline"></div>
Similarly, if <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">fn</code></span> is a delegate, it must not have unshared aliases, meaning
<span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">fn</code></span> must be either <span class="d_inlinecode donthyphenate notranslate">shared</span> or <span class="d_inlinecode donthyphenate notranslate">immutable</span>.</p></div>
<span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">static</span> <span class="d_keyword">void</span> f(string msg)
{
writeln(msg); <span class="d_comment">// "Hello World"
</span>}
<span class="d_keyword">auto</span> tid = <span class="d_psymbol">spawn</span>(&amp;f, <span class="d_string">"Hello World"</span>);
</pre>
</div></div>
<span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples">Fails: char[] has mutable aliasing.
<pre class="d_code notranslate">string msg = <span class="d_string">"Hello, World!"</span>;
<span class="d_keyword">static</span> <span class="d_keyword">void</span> f1(string msg) {}
<span class="d_keyword">static</span> <span class="d_keyword">assert</span>(!<span class="d_keyword">__traits</span>(compiles, <span class="d_psymbol">spawn</span>(&amp;f1, msg.dup)));
<span class="d_keyword">static</span> <span class="d_keyword">assert</span>( <span class="d_keyword">__traits</span>(compiles, <span class="d_psymbol">spawn</span>(&amp;f1, msg.idup)));
<span class="d_keyword">static</span> <span class="d_keyword">void</span> f2(<span class="d_keyword">char</span>[] msg) {}
<span class="d_keyword">static</span> <span class="d_keyword">assert</span>(!<span class="d_keyword">__traits</span>(compiles, <span class="d_psymbol">spawn</span>(&amp;f2, msg.dup)));
<span class="d_keyword">static</span> <span class="d_keyword">assert</span>(!<span class="d_keyword">__traits</span>(compiles, <span class="d_psymbol">spawn</span>(&amp;f2, msg.idup)));
</pre>
</div></div>
<span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples">New thread with anonymous function
<pre class="d_code notranslate"><span class="d_psymbol">spawn</span>({
ownerTid.send(<span class="d_string">"This is so great!"</span>);
});
writeln(receiveOnly!string); <span class="d_comment">// "This is so great!"
</span></pre>
</div></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".spawnLinked"></span><div class="quickindex" id="quickindex.spawnLinked"></div>Tid <span class="def-anchor" id="spawnLinked"></span><code class="ddoc_psymbol">spawnLinked</code><span class="template_param_list" title="Template parameter list">(F, T...)</span>(F <code class="ddoc_param">fn</code>, T <code class="ddoc_param">args</code>)<br><span class="constraint">if (isSpawnable!(F, T))</span>;
<br></div></dt>
<dd><div class="summary">Starts <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">fn</code>(<code class="ddoc_param">args</code>)</span> in a logical thread and will receive a <span class="d_inlinecode donthyphenate notranslate">LinkTerminated</span>
message when the operation terminates.
</div><div class="description">Executes the supplied function in a new logical thread represented by
<span class="d_inlinecode donthyphenate notranslate">Tid</span>. This new thread is linked to the calling thread so that if either
it or the calling thread terminates a <span class="d_inlinecode donthyphenate notranslate">LinkTerminated</span> message will be sent
to the other, causing a <span class="d_inlinecode donthyphenate notranslate">LinkTerminated</span> exception to be thrown on <span class="d_inlinecode donthyphenate notranslate">receive()</span>.
The owner relationship from <span class="d_inlinecode donthyphenate notranslate">spawn()</span> is preserved as well, so if the link
between threads is broken, owner termination will still result in an
<span class="d_inlinecode donthyphenate notranslate">OwnerTerminated</span> exception to be thrown on <span class="d_inlinecode donthyphenate notranslate">receive()</span>.
</div>
<div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">F <code class="ddoc_param">fn</code></td>
<td class="param_desc">The function to execute.</td></tr>
<tr class="param"><td class="param_id">T <code class="ddoc_param">args</code></td>
<td class="param_desc">Arguments to the function.</td></tr>
</table></div></div>
<div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">A Tid representing the new thread.</div></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".send"></span><div class="quickindex" id="quickindex.send"></div>void <span class="def-anchor" id="send"></span><code class="ddoc_psymbol">send</code><span class="template_param_list" title="Template parameter list">(T...)</span>(Tid <code class="ddoc_param">tid</code>, T <code class="ddoc_param">vals</code>);
<br></div></dt>
<dd><div class="summary">Places the values as a message at the back of tid's message queue.
</div><div class="description">Sends the supplied value to the thread represented by tid. As with
<a href="std_concurrency.html#.spawn"><span class="d_inlinecode donthyphenate notranslate">std.concurrency.spawn</span></a>, <span class="d_inlinecode donthyphenate notranslate">T</span> must not have unshared aliasing.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".prioritySend"></span><div class="quickindex" id="quickindex.prioritySend"></div>void <span class="def-anchor" id="prioritySend"></span><code class="ddoc_psymbol">prioritySend</code><span class="template_param_list" title="Template parameter list">(T...)</span>(Tid <code class="ddoc_param">tid</code>, T <code class="ddoc_param">vals</code>);
<br></div></dt>
<dd><div class="summary">Places the values as a message on the front of tid's message queue.
</div><div class="description">Send a message to <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">tid</code></span> but place it at the front of <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">tid</code></span>'s message
queue instead of at the back. This function is typically used for
out-of-band communication, to signal exceptional conditions, etc.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".receive"></span><div class="quickindex" id="quickindex.receive"></div>void <span class="def-anchor" id="receive"></span><code class="ddoc_psymbol">receive</code><span class="template_param_list" title="Template parameter list">(T...)</span>(T <code class="ddoc_param">ops</code>);
<br></div></dt>
<dd><div class="summary">Receives a message from another thread.
</div><div class="description">Receive a message from another thread, or block if no messages of the
specified types are available. This function works by pattern matching
a message against a set of delegates and executing the first match found.
<div class="blankline"></div>
If a delegate that accepts a <a href="std_variant.html#.Variant"><span class="d_inlinecode donthyphenate notranslate">std.variant.Variant</span></a> is included as
the last argument to <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="receive"></span><code class="ddoc_psymbol">receive</code></span>, it will match any message that was not
matched by an earlier delegate. If more than one argument is sent,
the <span class="d_inlinecode donthyphenate notranslate">Variant</span> will contain a <a href="std_typecons.html#.Tuple"><span class="d_inlinecode donthyphenate notranslate">std.typecons.Tuple</span></a> of all values
sent.
</div>
<div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">T <code class="ddoc_param">ops</code></td>
<td class="param_desc">Variadic list of function pointers and delegates. Entries
in this list must not occlude later entries.</td></tr>
</table></div></div>
<div class="keyval Throws"><span class="key keyThrows">Throws:</span> <div class="val valThrows"><a href="#OwnerTerminated"><span class="d_inlinecode donthyphenate notranslate">OwnerTerminated</span></a> when the sending thread was terminated.</div></div>
<span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.variant : Variant;
<span class="d_keyword">auto</span> process = ()
{
<span class="d_psymbol">receive</span>(
(<span class="d_keyword">int</span> i) { ownerTid.send(1); },
(<span class="d_keyword">double</span> f) { ownerTid.send(2); },
(Variant v) { ownerTid.send(3); }
);
};
{
<span class="d_keyword">auto</span> tid = spawn(process);
send(tid, 42);
writeln(receiveOnly!<span class="d_keyword">int</span>); <span class="d_comment">// 1
</span>}
{
<span class="d_keyword">auto</span> tid = spawn(process);
send(tid, 3.14);
writeln(receiveOnly!<span class="d_keyword">int</span>); <span class="d_comment">// 2
</span>}
{
<span class="d_keyword">auto</span> tid = spawn(process);
send(tid, <span class="d_string">"something else"</span>);
writeln(receiveOnly!<span class="d_keyword">int</span>); <span class="d_comment">// 3
</span>}
</pre>
</div></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".receiveOnly"></span><div class="quickindex" id="quickindex.receiveOnly"></div>receiveOnlyRet!T <span class="def-anchor" id="receiveOnly"></span><code class="ddoc_psymbol">receiveOnly</code><span class="template_param_list" title="Template parameter list">(T...)</span>();
<br></div></dt>
<dd><div class="summary">Receives only messages with arguments of the specified types.
</div><div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">T</td>
<td class="param_desc">Variadic list of types to be received.</td></tr>
</table></div></div>
<div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">The received message. If <span class="d_inlinecode donthyphenate notranslate">T</span> has more than one entry,
the message will be packed into a <a href="std_typecons.html#.Tuple"><span class="d_inlinecode donthyphenate notranslate">std.typecons.Tuple</span></a>.
</div></div>
<div class="keyval Throws"><span class="key keyThrows">Throws:</span> <div class="val valThrows"><a href="#MessageMismatch"><span class="d_inlinecode donthyphenate notranslate">MessageMismatch</span></a> if a message of types other than <span class="d_inlinecode donthyphenate notranslate">T</span>
is received,
<a href="#OwnerTerminated"><span class="d_inlinecode donthyphenate notranslate">OwnerTerminated</span></a> when the sending thread was terminated.</div></div>
<span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">auto</span> tid = spawn(
{
<span class="d_keyword">assert</span>(<span class="d_psymbol">receiveOnly</span>!<span class="d_keyword">int</span> == 42);
});
send(tid, 42);
</pre>
</div></div>
<span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">auto</span> tid = spawn(
{
<span class="d_keyword">assert</span>(<span class="d_psymbol">receiveOnly</span>!string == <span class="d_string">"text"</span>);
});
send(tid, <span class="d_string">"text"</span>);
</pre>
</div></div>
<span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">struct</span> Record { string name; <span class="d_keyword">int</span> age; }
<span class="d_keyword">auto</span> tid = spawn(
{
<span class="d_keyword">auto</span> msg = <span class="d_psymbol">receiveOnly</span>!(<span class="d_keyword">double</span>, Record);
<span class="d_keyword">assert</span>(msg[0] == 0.5);
<span class="d_keyword">assert</span>(msg[1].name == <span class="d_string">"Alice"</span>);
<span class="d_keyword">assert</span>(msg[1].age == 31);
});
send(tid, 0.5, Record(<span class="d_string">"Alice"</span>, 31));
</pre>
</div></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".receiveTimeout"></span><div class="quickindex" id="quickindex.receiveTimeout"></div>bool <span class="def-anchor" id="receiveTimeout"></span><code class="ddoc_psymbol">receiveTimeout</code><span class="template_param_list" title="Template parameter list">(T...)</span>(Duration <code class="ddoc_param">duration</code>, T <code class="ddoc_param">ops</code>);
<br></div></dt>
<dd><div class="summary">Receives a message from another thread and gives up if no match
arrives within a specified duration.
</div><div class="description">Receive a message from another thread, or block until <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">duration</code></span> exceeds,
if no messages of the specified types are available. This function works
by pattern matching a message against a set of delegates and executing
the first match found.
<div class="blankline"></div>
If a delegate that accepts a <a href="std_variant.html#.Variant"><span class="d_inlinecode donthyphenate notranslate">std.variant.Variant</span></a> is included as
the last argument, it will match any message that was not
matched by an earlier delegate. If more than one argument is sent,
the <span class="d_inlinecode donthyphenate notranslate">Variant</span> will contain a <a href="std_typecons.html#.Tuple"><span class="d_inlinecode donthyphenate notranslate">std.typecons.Tuple</span></a> of all values
sent.
</div>
<div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">Duration <code class="ddoc_param">duration</code></td>
<td class="param_desc">Duration, how long to wait. If <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">duration</code></span> is negative,
won't wait at all.</td></tr>
<tr class="param"><td class="param_id">T <code class="ddoc_param">ops</code></td>
<td class="param_desc">Variadic list of function pointers and delegates. Entries
in this list must not occlude later entries.</td></tr>
</table></div></div>
<div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns"><span class="d_inlinecode donthyphenate notranslate">true</span> if it received a message and <span class="d_inlinecode donthyphenate notranslate">false</span> if it timed out waiting
for one.
</div></div>
<div class="keyval Throws"><span class="key keyThrows">Throws:</span> <div class="val valThrows"><a href="#OwnerTerminated"><span class="d_inlinecode donthyphenate notranslate">OwnerTerminated</span></a> when the sending thread was terminated.</div></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".OnCrowding"></span><div class="quickindex" id="quickindex.OnCrowding"></div>enum <span class="def-anchor" id="OnCrowding"></span><code class="ddoc_psymbol">OnCrowding</code>: int;
<br></div></dt>
<dd><div class="summary">These behaviors may be specified when a mailbox is full.</div>
<dl><dt class="d_decl"><div ><span class="def-anchor" id=".OnCrowding.block"></span><div class="quickindex" id="quickindex.OnCrowding.block"></div><span class="def-anchor" id="block"></span><code class="ddoc_psymbol">block</code><br></div></dt>
<dd><div class="summary">Wait until room is available.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".OnCrowding.throwException"></span><div class="quickindex" id="quickindex.OnCrowding.throwException"></div><span class="def-anchor" id="throwException"></span><code class="ddoc_psymbol">throwException</code><br></div></dt>
<dd><div class="summary">Throw a <a href="#MailboxFull"><span class="d_inlinecode donthyphenate notranslate">MailboxFull</span></a> exception.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".OnCrowding.ignore"></span><div class="quickindex" id="quickindex.OnCrowding.ignore"></div><span class="def-anchor" id="ignore"></span><code class="ddoc_psymbol">ignore</code><br></div></dt>
<dd><div class="summary">Abort the send and return.</div>
</dd>
</dl>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".setMaxMailboxSize"></span><div class="quickindex" id="quickindex.setMaxMailboxSize"></div>pure @safe void <span class="def-anchor" id="setMaxMailboxSize"></span><code class="ddoc_psymbol">setMaxMailboxSize</code>(Tid <code class="ddoc_param">tid</code>, size_t <code class="ddoc_param">messages</code>, OnCrowding <code class="ddoc_param">doThis</code>);
<br></div></dt>
<dd><div class="summary">Sets a maximum mailbox size.
</div><div class="description">Sets a limit on the maximum number of user messages allowed in the mailbox.
If this limit is reached, the caller attempting to add a new message will
execute the behavior specified by doThis. If messages is zero, the mailbox
is unbounded.
</div>
<div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">Tid <code class="ddoc_param">tid</code></td>
<td class="param_desc">The Tid of the thread for which this limit should be set.</td></tr>
<tr class="param"><td class="param_id">size_t <code class="ddoc_param">messages</code></td>
<td class="param_desc">The maximum number of messages or zero if no limit.</td></tr>
<tr class="param"><td class="param_id">OnCrowding <code class="ddoc_param">doThis</code></td>
<td class="param_desc">The behavior executed when a message is sent to a full
mailbox.</td></tr>
</table></div></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".setMaxMailboxSize.2"></span><div class="quickindex" id="quickindex.setMaxMailboxSize.2"></div>void <span class="def-anchor" id="setMaxMailboxSize"></span><code class="ddoc_psymbol">setMaxMailboxSize</code>(Tid <code class="ddoc_param">tid</code>, size_t <code class="ddoc_param">messages</code>, bool function(Tid) <code class="ddoc_param">onCrowdingDoThis</code>);
<br></div></dt>
<dd><div class="summary">Sets a maximum mailbox size.
</div><div class="description">Sets a limit on the maximum number of user messages allowed in the mailbox.
If this limit is reached, the caller attempting to add a new message will
execute onCrowdingDoThis. If messages is zero, the mailbox is unbounded.
</div>
<div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">Tid <code class="ddoc_param">tid</code></td>
<td class="param_desc">The Tid of the thread for which this limit should be set.</td></tr>
<tr class="param"><td class="param_id">size_t <code class="ddoc_param">messages</code></td>
<td class="param_desc">The maximum number of messages or zero if no limit.</td></tr>
<tr class="param"><td class="param_id">bool function(Tid) <code class="ddoc_param">onCrowdingDoThis</code></td>
<td class="param_desc">The routine called when a message is sent to a full
mailbox.</td></tr>
</table></div></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".register"></span><div class="quickindex" id="quickindex.register"></div>bool <span class="def-anchor" id="register"></span><code class="ddoc_psymbol">register</code>(string <code class="ddoc_param">name</code>, Tid <code class="ddoc_param">tid</code>);
<br></div></dt>
<dd><div class="summary">Associates name with tid.
</div><div class="description">Associates name with tid in a process-local map. When the thread
represented by tid terminates, any names associated with it will be
automatically unregistered.
</div>
<div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">string <code class="ddoc_param">name</code></td>
<td class="param_desc">The name to associate with tid.</td></tr>
<tr class="param"><td class="param_id">Tid <code class="ddoc_param">tid</code></td>
<td class="param_desc">The tid register by name.</td></tr>
</table></div></div>
<div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">true if the name is available and tid is not known to represent a
defunct thread.</div></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".unregister"></span><div class="quickindex" id="quickindex.unregister"></div>bool <span class="def-anchor" id="unregister"></span><code class="ddoc_psymbol">unregister</code>(string <code class="ddoc_param">name</code>);
<br></div></dt>
<dd><div class="summary">Removes the registered name associated with a tid.
</div><div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">string <code class="ddoc_param">name</code></td>
<td class="param_desc">The name to unregister.</td></tr>
</table></div></div>
<div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">true if the name is registered, false if not.</div></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".locate"></span><div class="quickindex" id="quickindex.locate"></div>Tid <span class="def-anchor" id="locate"></span><code class="ddoc_psymbol">locate</code>(string <code class="ddoc_param">name</code>);
<br></div></dt>
<dd><div class="summary">Gets the <span class="d_inlinecode donthyphenate notranslate">Tid</span> associated with name.
</div><div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">string <code class="ddoc_param">name</code></td>
<td class="param_desc">The name to locate within the registry.</td></tr>
</table></div></div>
<div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">The associated <span class="d_inlinecode donthyphenate notranslate">Tid</span> or <span class="d_inlinecode donthyphenate notranslate">Tid.init</span> if name is not registered.</div></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".join"></span><div class="quickindex" id="quickindex.join"></div>void <span class="def-anchor" id="join"></span><code class="ddoc_psymbol">join</code>(Tid <code class="ddoc_param">tid</code>);
<br></div></dt>
<dd><div class="summary">Waits for the thread associated with <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">tid</code></span> to complete.
</div><div class="description">This function blocks until the thread represented by <span class="d_inlinecode donthyphenate notranslate"><code class="ddoc_param">tid</code></span> finishes executing
and then releases all OS resources associated with it (thread stack, thread-local
storage, etc.). This is essential for preventing resource leaks in long-running
applications that create many short-lived threads.
<div class="blankline"></div>
For threads created by <a href="#spawn"><span class="d_inlinecode donthyphenate notranslate">spawn</span></a>, this function must be called to properly
free OS resources. Without calling <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="join"></span><code class="ddoc_psymbol">join</code></span>, thread stacks (~8 MB each on typical
systems) will accumulate in virtual memory for the lifetime of the process.
</div>
<div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">Tid <code class="ddoc_param">tid</code></td>
<td class="param_desc">The <a href="#Tid"><span class="d_inlinecode donthyphenate notranslate">Tid</span></a> of the thread to join.</td></tr>
</table></div></div>
<div class="keyval Throws"><span class="key keyThrows">Throws:</span> <div class="val valThrows"><a href="core_thread_osthread.html#.ThreadError"><span class="d_inlinecode donthyphenate notranslate">core.thread.osthread.ThreadError</span></a> if the thread has already been joined
or if the thread was created by a custom <a href="#Scheduler"><span class="d_inlinecode donthyphenate notranslate">Scheduler</span></a>.
</div></div>
<div class="val"><p class="keyval Section"><span class="key keySection">Example</span>
<pre class="d_code notranslate"><span class="d_keyword">auto</span> <span class="d_param">tid</span> = spawn(&amp;someFunction);
<span class="d_comment">// ... do other work ...
</span><span class="d_psymbol">join</span>(<span class="d_param">tid</span>); <span class="d_comment">// Wait for thread to complete and free resources
</span></pre>
</p></div>
<div class="val"><p class="keyval Section"><span class="key keySection">Note</span>
It is an error to call <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="join"></span><code class="ddoc_psymbol">join</code></span> on the same <span class="d_inlinecode donthyphenate notranslate">Tid</span> more than once.
The function will throw if the thread was created by a <a href="#Scheduler"><span class="d_inlinecode donthyphenate notranslate">Scheduler</span></a>
rather than directly as a system thread.</p></div>
<span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> core.time : msecs;
<span class="d_keyword">import</span> core.thread : Thread;
<span class="d_keyword">auto</span> <span class="d_param">tid</span> = spawn((<span class="d_keyword">int</span> x) {
Thread.sleep(10.msecs);
ownerTid.send(x * 2);
}, 21);
<span class="d_psymbol">join</span>(<span class="d_param">tid</span>); <span class="d_comment">// Wait for thread to finish
</span><span class="d_keyword">auto</span> result = receiveOnly!<span class="d_keyword">int</span>();
writeln(result); <span class="d_comment">// 42
</span></pre>
</div></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".ThreadInfo"></span><div class="quickindex" id="quickindex.ThreadInfo"></div>struct <span class="def-anchor" id="ThreadInfo"></span><code class="ddoc_psymbol">ThreadInfo</code>;
<br></div></dt>
<dd><div class="summary">Encapsulates all implementation-level data needed for scheduling.
</div><div class="description">When defining a <a href="#Scheduler"><span class="d_inlinecode donthyphenate notranslate">Scheduler</span></a>, an instance of this struct must be associated
with each logical thread. It contains all implementation-level information
needed by the internal API.</div>
<dl><dt class="d_decl"><div ><span class="def-anchor" id=".ThreadInfo.thisInfo"></span><div class="quickindex" id="quickindex.ThreadInfo.thisInfo"></div>static nothrow @property ref auto <span class="def-anchor" id="thisInfo"></span><code class="ddoc_psymbol">thisInfo</code>();
<br></div></dt>
<dd><div class="summary">Gets a thread-local instance of <span class="d_inlinecode donthyphenate notranslate">ThreadInfo</span>.
</div><div class="description">Gets a thread-local instance of <span class="d_inlinecode donthyphenate notranslate">ThreadInfo</span>, which should be used as the
default instance when info is requested for a thread not created by the
<span class="d_inlinecode donthyphenate notranslate">Scheduler</span>.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".ThreadInfo.cleanup"></span><div class="quickindex" id="quickindex.ThreadInfo.cleanup"></div>void <span class="def-anchor" id="cleanup"></span><code class="ddoc_psymbol">cleanup</code>();
<br></div></dt>
<dd><div class="summary">Cleans up this ThreadInfo.
</div><div class="description">This must be called when a scheduled thread terminates. It tears down
the messaging system for the thread and notifies interested parties of
the thread's termination.</div>
</dd>
</dl>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".Scheduler"></span><div class="quickindex" id="quickindex.Scheduler"></div>interface <span class="def-anchor" id="Scheduler"></span><code class="ddoc_psymbol">Scheduler</code>;
<br></div></dt>
<dd><div class="summary">A <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="Scheduler"></span><code class="ddoc_psymbol">Scheduler</code></span> controls how threading is performed by spawn.
</div><div class="description">Implementing a <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="Scheduler"></span><code class="ddoc_psymbol">Scheduler</code></span> allows the concurrency mechanism used by this
module to be customized according to different needs. By default, a call
to spawn will create a new kernel thread that executes the supplied routine
and terminates when finished. But it is possible to create <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="Scheduler"></span><code class="ddoc_psymbol">Scheduler</code></span>s that
reuse threads, that multiplex <span class="d_inlinecode donthyphenate notranslate">Fiber</span>s (coroutines) across a single thread,
or any number of other approaches. By making the choice of <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="Scheduler"></span><code class="ddoc_psymbol">Scheduler</code></span> a
user-level option, <span class="d_inlinecode donthyphenate notranslate">std.concurrency</span> may be used for far more types of
application than if this behavior were predefined.
</div>
<div class="val"><p class="keyval Section"><span class="key keySection">Example</span>
<pre class="d_code notranslate"><span class="d_keyword">import</span> std.concurrency;
<span class="d_keyword">import</span> std.stdio;
<span class="d_keyword">void</span> main()
{
scheduler = <span class="d_keyword">new</span> FiberScheduler;
scheduler.start(
{
writeln(<span class="d_string">"the rest of main goes here"</span>);
});
}
</pre>
<div class="blankline"></div>
Some schedulers have a dispatching loop that must run if they are to work
properly, so for the sake of consistency, when using a scheduler, <span class="d_inlinecode donthyphenate notranslate">start()</span>
must be called within <span class="d_inlinecode donthyphenate notranslate">main()</span>. This yields control to the scheduler and
will ensure that any spawned threads are executed in an expected manner.</p></div>
<dl><dt class="d_decl"><div ><span class="def-anchor" id=".Scheduler.start"></span><div class="quickindex" id="quickindex.Scheduler.start"></div>abstract void <span class="def-anchor" id="start"></span><code class="ddoc_psymbol">start</code>(void delegate() <code class="ddoc_param">op</code>);
<br></div></dt>
<dd><div class="summary">Spawns the supplied op and starts the <span class="d_inlinecode donthyphenate notranslate">Scheduler</span>.
</div><div class="description">This is intended to be called at the start of the program to yield all
scheduling to the active <span class="d_inlinecode donthyphenate notranslate">Scheduler</span> instance. This is necessary for
schedulers that explicitly dispatch threads rather than simply relying
on the operating system to do so, and so start should always be called
within <span class="d_inlinecode donthyphenate notranslate">main()</span> to begin normal program execution.
</div>
<div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">void delegate() <code class="ddoc_param">op</code></td>
<td class="param_desc">A wrapper for whatever the main thread would have done in the
absence of a custom scheduler. It will be automatically executed
via a call to spawn by the <span class="d_inlinecode donthyphenate notranslate">Scheduler</span>.</td></tr>
</table></div></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".Scheduler.spawn"></span><div class="quickindex" id="quickindex.Scheduler.spawn"></div>abstract void <span class="def-anchor" id="spawn"></span><code class="ddoc_psymbol">spawn</code>(void delegate() <code class="ddoc_param">op</code>);
<br></div></dt>
<dd><div class="summary">Assigns a logical thread to execute the supplied op.
</div><div class="description">This routine is called by spawn. It is expected to instantiate a new
logical thread and run the supplied operation. This thread must call
<span class="d_inlinecode donthyphenate notranslate">thisInfo.cleanup()</span> when the thread terminates if the scheduled thread
is not a kernel thread--all kernel threads will have their <span class="d_inlinecode donthyphenate notranslate">ThreadInfo</span>
cleaned up automatically by a thread-local destructor.
</div>
<div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">void delegate() <code class="ddoc_param">op</code></td>
<td class="param_desc">The function to execute. This may be the actual function passed
by the user to spawn itself, or may be a wrapper function.</td></tr>
</table></div></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".Scheduler.yield"></span><div class="quickindex" id="quickindex.Scheduler.yield"></div>abstract nothrow void <span class="def-anchor" id="yield"></span><code class="ddoc_psymbol">yield</code>();
<br></div></dt>
<dd><div class="summary">Yields execution to another logical thread.
</div><div class="description">This routine is called at various points within concurrency-aware APIs
to provide a scheduler a chance to yield execution when using some sort
of cooperative multithreading model. If this is not appropriate, such
as when each logical thread is backed by a dedicated kernel thread,
this routine may be a no-op.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".Scheduler.thisInfo"></span><div class="quickindex" id="quickindex.Scheduler.thisInfo"></div>abstract nothrow @property ref ThreadInfo <span class="def-anchor" id="thisInfo"></span><code class="ddoc_psymbol">thisInfo</code>();
<br></div></dt>
<dd><div class="summary">Returns an appropriate <span class="d_inlinecode donthyphenate notranslate">ThreadInfo</span> instance.
</div><div class="description">Returns an instance of <span class="d_inlinecode donthyphenate notranslate">ThreadInfo</span> specific to the logical thread that
is calling this routine or, if the calling thread was not create by
this scheduler, returns <span class="d_inlinecode donthyphenate notranslate">ThreadInfo.<span class="def-anchor" id="thisInfo"></span><code class="ddoc_psymbol">thisInfo</code></span> instead.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".Scheduler.newCondition"></span><div class="quickindex" id="quickindex.Scheduler.newCondition"></div>abstract nothrow Condition <span class="def-anchor" id="newCondition"></span><code class="ddoc_psymbol">newCondition</code>(Mutex <code class="ddoc_param">m</code>);
<br></div></dt>
<dd><div class="summary">Creates a <span class="d_inlinecode donthyphenate notranslate">Condition</span> variable analog for signaling.
</div><div class="description">Creates a new <span class="d_inlinecode donthyphenate notranslate">Condition</span> variable analog which is used to check for and
to signal the addition of messages to a thread's message queue. Like
yield, some schedulers may need to define custom behavior so that calls
to <span class="d_inlinecode donthyphenate notranslate">Condition.wait()</span> yield to another thread when no new messages are
available instead of blocking.
</div>
<div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">Mutex <code class="ddoc_param">m</code></td>
<td class="param_desc">The <span class="d_inlinecode donthyphenate notranslate">Mutex</span> that will be associated with this condition. It will be
locked prior to any operation on the condition, and so in some
cases a <span class="d_inlinecode donthyphenate notranslate">Scheduler</span> may need to hold this reference and unlock the
mutex before yielding execution to another logical thread.</td></tr>
</table></div></div>
</dd>
</dl>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".ThreadScheduler"></span><div class="quickindex" id="quickindex.ThreadScheduler"></div>class <span class="def-anchor" id="ThreadScheduler"></span><code class="ddoc_psymbol">ThreadScheduler</code>: <span class="ddoc_psuper_symbol">std.concurrency.Scheduler</span>;
<br></div></dt>
<dd><div class="summary">An example <span class="d_inlinecode donthyphenate notranslate">Scheduler</span> using kernel threads.
</div><div class="description">This is an example <span class="d_inlinecode donthyphenate notranslate">Scheduler</span> that mirrors the default scheduling behavior
of creating one kernel thread per call to spawn. It is fully functional
and may be instantiated and used, but is not a necessary part of the
default functioning of this module.</div>
<dl><dt class="d_decl"><div ><span class="def-anchor" id=".ThreadScheduler.start"></span><div class="quickindex" id="quickindex.ThreadScheduler.start"></div>void <span class="def-anchor" id="start"></span><code class="ddoc_psymbol">start</code>(void delegate() <code class="ddoc_param">op</code>);
<br></div></dt>
<dd><div class="summary">This simply runs op directly, since no real scheduling is needed by
this approach.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".ThreadScheduler.spawn"></span><div class="quickindex" id="quickindex.ThreadScheduler.spawn"></div>void <span class="def-anchor" id="spawn"></span><code class="ddoc_psymbol">spawn</code>(void delegate() <code class="ddoc_param">op</code>);
<br></div></dt>
<dd><div class="summary">Creates a new kernel thread and assigns it to run the supplied op.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".ThreadScheduler.yield"></span><div class="quickindex" id="quickindex.ThreadScheduler.yield"></div>nothrow void <span class="def-anchor" id="yield"></span><code class="ddoc_psymbol">yield</code>();
<br></div></dt>
<dd><div class="summary">This scheduler does no explicit multiplexing, so this is a no-op.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".ThreadScheduler.thisInfo"></span><div class="quickindex" id="quickindex.ThreadScheduler.thisInfo"></div>nothrow @property ref ThreadInfo <span class="def-anchor" id="thisInfo"></span><code class="ddoc_psymbol">thisInfo</code>();
<br></div></dt>
<dd><div class="summary">Returns <span class="d_inlinecode donthyphenate notranslate">ThreadInfo.<span class="def-anchor" id="thisInfo"></span><code class="ddoc_psymbol">thisInfo</code></span>, since it is a thread-local instance of
<span class="d_inlinecode donthyphenate notranslate">ThreadInfo</span>, which is the correct behavior for this scheduler.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".ThreadScheduler.newCondition"></span><div class="quickindex" id="quickindex.ThreadScheduler.newCondition"></div>nothrow Condition <span class="def-anchor" id="newCondition"></span><code class="ddoc_psymbol">newCondition</code>(Mutex <code class="ddoc_param">m</code>);
<br></div></dt>
<dd><div class="summary">Creates a new <span class="d_inlinecode donthyphenate notranslate">Condition</span> variable. No custom behavior is needed here.</div>
</dd>
</dl>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".FiberScheduler"></span><div class="quickindex" id="quickindex.FiberScheduler"></div>class <span class="def-anchor" id="FiberScheduler"></span><code class="ddoc_psymbol">FiberScheduler</code>: <span class="ddoc_psuper_symbol">std.concurrency.Scheduler</span>;
<br></div></dt>
<dd><div class="summary">An example <span class="d_inlinecode donthyphenate notranslate">Scheduler</span> using <a href="core_thread_fiber.html"><span class="d_inlinecode donthyphenate notranslate">Fiber</span>s</a>.
</div><div class="description">This is an example scheduler that creates a new <span class="d_inlinecode donthyphenate notranslate">Fiber</span> per call to spawn
and multiplexes the execution of all fibers within the main thread.</div>
<dl><dt class="d_decl"><div ><span class="def-anchor" id=".FiberScheduler.start"></span><div class="quickindex" id="quickindex.FiberScheduler.start"></div>void <span class="def-anchor" id="start"></span><code class="ddoc_psymbol">start</code>(void delegate() <code class="ddoc_param">op</code>);
<br></div></dt>
<dd><div class="summary">This creates a new <span class="d_inlinecode donthyphenate notranslate">Fiber</span> for the supplied op and then starts the
dispatcher.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".FiberScheduler.spawn"></span><div class="quickindex" id="quickindex.FiberScheduler.spawn"></div>nothrow void <span class="def-anchor" id="spawn"></span><code class="ddoc_psymbol">spawn</code>(void delegate() <code class="ddoc_param">op</code>);
<br></div></dt>
<dd><div class="summary">This created a new <span class="d_inlinecode donthyphenate notranslate">Fiber</span> for the supplied op and adds it to the
dispatch list.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".FiberScheduler.yield"></span><div class="quickindex" id="quickindex.FiberScheduler.yield"></div>nothrow void <span class="def-anchor" id="yield"></span><code class="ddoc_psymbol">yield</code>();
<br></div></dt>
<dd><div class="summary">If the caller is a scheduled <span class="d_inlinecode donthyphenate notranslate">Fiber</span>, this yields execution to another
scheduled <span class="d_inlinecode donthyphenate notranslate">Fiber</span>.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".FiberScheduler.thisInfo"></span><div class="quickindex" id="quickindex.FiberScheduler.thisInfo"></div>nothrow @property ref ThreadInfo <span class="def-anchor" id="thisInfo"></span><code class="ddoc_psymbol">thisInfo</code>();
<br></div></dt>
<dd><div class="summary">Returns an appropriate <span class="d_inlinecode donthyphenate notranslate">ThreadInfo</span> instance.
</div><div class="description">Returns a <span class="d_inlinecode donthyphenate notranslate">ThreadInfo</span> instance specific to the calling <span class="d_inlinecode donthyphenate notranslate">Fiber</span> if the
<span class="d_inlinecode donthyphenate notranslate">Fiber</span> was created by this dispatcher, otherwise it returns
<span class="d_inlinecode donthyphenate notranslate">ThreadInfo.<span class="def-anchor" id="thisInfo"></span><code class="ddoc_psymbol">thisInfo</code></span>.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".FiberScheduler.newCondition"></span><div class="quickindex" id="quickindex.FiberScheduler.newCondition"></div>nothrow Condition <span class="def-anchor" id="newCondition"></span><code class="ddoc_psymbol">newCondition</code>(Mutex <code class="ddoc_param">m</code>);
<br></div></dt>
<dd><div class="summary">Returns a <span class="d_inlinecode donthyphenate notranslate">Condition</span> analog that yields when wait or notify is called.
</div><div class="val"><p class="keyval Section"><span class="key keySection">Bug</span>
For the default implementation, <span class="d_inlinecode donthyphenate notranslate">notifyAll</span> will behave like <span class="d_inlinecode donthyphenate notranslate">notify</span>.
</p></div>
<div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">Mutex <code class="ddoc_param">m</code></td>
<td class="param_desc">A <span class="d_inlinecode donthyphenate notranslate">Mutex</span> to use for locking if the condition needs to be waited on
or notified from multiple <span class="d_inlinecode donthyphenate notranslate">Thread</span>s.
If <span class="d_inlinecode donthyphenate notranslate">null</span>, no <span class="d_inlinecode donthyphenate notranslate">Mutex</span> will be used and it is assumed that the
<span class="d_inlinecode donthyphenate notranslate">Condition</span> is only waited on/notified from one <span class="d_inlinecode donthyphenate notranslate">Thread</span>.</td></tr>
</table></div></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".FiberScheduler.create"></span><div class="quickindex" id="quickindex.FiberScheduler.create"></div>protected nothrow void <span class="def-anchor" id="create"></span><code class="ddoc_psymbol">create</code>(void delegate() <code class="ddoc_param">op</code>);
<br></div></dt>
<dd><div class="summary">Creates a new <span class="d_inlinecode donthyphenate notranslate">Fiber</span> which calls the given delegate.
</div><div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">void delegate() <code class="ddoc_param">op</code></td>
<td class="param_desc">The delegate the fiber should call</td></tr>
</table></div></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".FiberScheduler.InfoFiber"></span><div class="quickindex" id="quickindex.FiberScheduler.InfoFiber"></div>class <span class="def-anchor" id="InfoFiber"></span><code class="ddoc_psymbol">InfoFiber</code>: <span class="ddoc_psuper_symbol">core.thread.fiber.Fiber</span>;
<br></div></dt>
<dd><div class="summary"><span class="d_inlinecode donthyphenate notranslate">Fiber</span> which embeds a <span class="d_inlinecode donthyphenate notranslate">ThreadInfo</span></div>
</dd>
</dl>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".scheduler"></span><div class="quickindex" id="quickindex.scheduler"></div>Scheduler <span class="def-anchor" id="scheduler"></span><code class="ddoc_psymbol">scheduler</code>;
<br></div></dt>
<dd><div class="summary">Sets the <span class="d_inlinecode donthyphenate notranslate">Scheduler</span> behavior within the program.
</div><div class="description">This variable sets the <span class="d_inlinecode donthyphenate notranslate">Scheduler</span> behavior within this program. Typically,
when setting a <span class="d_inlinecode donthyphenate notranslate">Scheduler</span>, <span class="d_inlinecode donthyphenate notranslate"><span class="def-anchor" id="scheduler"></span><code class="ddoc_psymbol">scheduler</code>.start()</span> should be called in <span class="d_inlinecode donthyphenate notranslate">main</span>. This
routine will not return until program execution is complete.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".yield"></span><div class="quickindex" id="quickindex.yield"></div>nothrow void <span class="def-anchor" id="yield"></span><code class="ddoc_psymbol">yield</code>();
<br></div></dt>
<dd><div class="summary">If the caller is a <span class="d_inlinecode donthyphenate notranslate">Fiber</span> and is not a <a href="#Generator"><span class="d_inlinecode donthyphenate notranslate">Generator</span></a>, this function will call
<span class="d_inlinecode donthyphenate notranslate">scheduler.<span class="def-anchor" id="yield"></span><code class="ddoc_psymbol">yield</code>()</span> or <span class="d_inlinecode donthyphenate notranslate">Fiber.<span class="def-anchor" id="yield"></span><code class="ddoc_psymbol">yield</code>()</span>, as appropriate.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".Generator"></span><div class="quickindex" id="quickindex.Generator"></div>class <span class="def-anchor" id="Generator"></span><code class="ddoc_psymbol">Generator</code>(T): Fiber, IsGenerator, InputRange!T;
<br></div></dt>
<dd><div class="summary">A Generator is a <a href="core_thread_fiber.html">Fiber</a>
that periodically returns values of type <span class="d_inlinecode donthyphenate notranslate">T</span> to the
caller via <span class="d_inlinecode donthyphenate notranslate">yield</span>. This is represented as an InputRange.</div><span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">auto</span> tid = spawn({
<span class="d_keyword">int</span> i;
<span class="d_keyword">while</span> (i &lt; 9)
i = receiveOnly!<span class="d_keyword">int</span>;
ownerTid.send(i * 2);
});
<span class="d_keyword">auto</span> r = <span class="d_keyword">new</span> <span class="d_psymbol">Generator</span>!<span class="d_keyword">int</span>({
<span class="d_keyword">foreach</span> (i; 1 .. 10)
yield(i);
});
<span class="d_keyword">foreach</span> (e; r)
tid.send(e);
writeln(receiveOnly!<span class="d_keyword">int</span>); <span class="d_comment">// 18
</span></pre>
</div></div>
<dl><dt class="d_decl"><div ><span class="def-anchor" id=".Generator.this"></span><div class="quickindex" id="quickindex.Generator.this"></div>this(void function() <code class="ddoc_param">fn</code>);
<br></div></dt>
<dd><div class="summary">Initializes a generator object which is associated with a static
D function. The function will be called once to prepare the range
for iteration.
</div><div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">void function() <code class="ddoc_param">fn</code></td>
<td class="param_desc">The fiber function.</td></tr>
</table></div></div>
<div class="val"><p class="keyval Section"><span class="key keySection">In</span>
fn must not be null.</p></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".Generator.this.2"></span><div class="quickindex" id="quickindex.Generator.this.2"></div>this(void function() <code class="ddoc_param">fn</code>, size_t <code class="ddoc_param">sz</code>);
<br></div></dt>
<dd><div class="summary">Initializes a generator object which is associated with a static
D function. The function will be called once to prepare the range
for iteration.
</div><div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">void function() <code class="ddoc_param">fn</code></td>
<td class="param_desc">The fiber function.</td></tr>
<tr class="param"><td class="param_id">size_t <code class="ddoc_param">sz</code></td>
<td class="param_desc">The stack size for this fiber.</td></tr>
</table></div></div>
<div class="val"><p class="keyval Section"><span class="key keySection">In</span>
fn must not be null.</p></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".Generator.this.3"></span><div class="quickindex" id="quickindex.Generator.this.3"></div>this(void function() <code class="ddoc_param">fn</code>, size_t <code class="ddoc_param">sz</code>, size_t <code class="ddoc_param">guardPageSize</code>);
<br></div></dt>
<dd><div class="summary">Initializes a generator object which is associated with a static
D function. The function will be called once to prepare the range
for iteration.
</div><div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">void function() <code class="ddoc_param">fn</code></td>
<td class="param_desc">The fiber function.</td></tr>
<tr class="param"><td class="param_id">size_t <code class="ddoc_param">sz</code></td>
<td class="param_desc">The stack size for this fiber.</td></tr>
<tr class="param"><td class="param_id">size_t <code class="ddoc_param">guardPageSize</code></td>
<td class="param_desc">size of the guard page to trap fiber's stack
overflows. Refer to <a href="core_thread.html#.Fiber"><span class="d_inlinecode donthyphenate notranslate">core.thread.Fiber</span></a>'s
documentation for more details.</td></tr>
</table></div></div>
<div class="val"><p class="keyval Section"><span class="key keySection">In</span>
fn must not be null.</p></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".Generator.this.4"></span><div class="quickindex" id="quickindex.Generator.this.4"></div>this(void delegate() <code class="ddoc_param">dg</code>);
<br></div></dt>
<dd><div class="summary">Initializes a generator object which is associated with a dynamic
D function. The function will be called once to prepare the range
for iteration.
</div><div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">void delegate() <code class="ddoc_param">dg</code></td>
<td class="param_desc">The fiber function.</td></tr>
</table></div></div>
<div class="val"><p class="keyval Section"><span class="key keySection">In</span>
dg must not be null.</p></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".Generator.this.5"></span><div class="quickindex" id="quickindex.Generator.this.5"></div>this(void delegate() <code class="ddoc_param">dg</code>, size_t <code class="ddoc_param">sz</code>);
<br></div></dt>
<dd><div class="summary">Initializes a generator object which is associated with a dynamic
D function. The function will be called once to prepare the range
for iteration.
</div><div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">void delegate() <code class="ddoc_param">dg</code></td>
<td class="param_desc">The fiber function.</td></tr>
<tr class="param"><td class="param_id">size_t <code class="ddoc_param">sz</code></td>
<td class="param_desc">The stack size for this fiber.</td></tr>
</table></div></div>
<div class="val"><p class="keyval Section"><span class="key keySection">In</span>
dg must not be null.</p></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".Generator.this.6"></span><div class="quickindex" id="quickindex.Generator.this.6"></div>this(void delegate() <code class="ddoc_param">dg</code>, size_t <code class="ddoc_param">sz</code>, size_t <code class="ddoc_param">guardPageSize</code>);
<br></div></dt>
<dd><div class="summary">Initializes a generator object which is associated with a dynamic
D function. The function will be called once to prepare the range
for iteration.
</div><div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">void delegate() <code class="ddoc_param">dg</code></td>
<td class="param_desc">The fiber function.</td></tr>
<tr class="param"><td class="param_id">size_t <code class="ddoc_param">sz</code></td>
<td class="param_desc">The stack size for this fiber.</td></tr>
<tr class="param"><td class="param_id">size_t <code class="ddoc_param">guardPageSize</code></td>
<td class="param_desc">size of the guard page to trap fiber's stack
overflows. Refer to <a href="core_thread.html#.Fiber"><span class="d_inlinecode donthyphenate notranslate">core.thread.Fiber</span></a>'s
documentation for more details.</td></tr>
</table></div></div>
<div class="val"><p class="keyval Section"><span class="key keySection">In</span>
dg must not be null.</p></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".Generator.empty"></span><div class="quickindex" id="quickindex.Generator.empty"></div>final @property bool <span class="def-anchor" id="empty"></span><code class="ddoc_psymbol">empty</code>();
<br></div></dt>
<dd><div class="summary">Returns true if the generator is empty.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".Generator.popFront"></span><div class="quickindex" id="quickindex.Generator.popFront"></div>final void <span class="def-anchor" id="popFront"></span><code class="ddoc_psymbol">popFront</code>();
<br></div></dt>
<dd><div class="summary">Obtains the next value from the underlying function.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".Generator.front"></span><div class="quickindex" id="quickindex.Generator.front"></div>final @property T <span class="def-anchor" id="front"></span><code class="ddoc_psymbol">front</code>();
<br></div></dt>
<dd><div class="summary">Returns the most recently generated value by shallow copy.</div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".Generator.moveFront"></span><div class="quickindex" id="quickindex.Generator.moveFront"></div>final T <span class="def-anchor" id="moveFront"></span><code class="ddoc_psymbol">moveFront</code>();
<br></div></dt>
<dd><div class="summary">Returns the most recently generated value without executing a
copy contructor. Will not compile for element types defining a
postblit, because <span class="d_inlinecode donthyphenate notranslate">Generator</span> does not return by reference.</div>
</dd>
</dl>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".yield.2"></span><div class="quickindex" id="quickindex.yield.2"></div>void <span class="def-anchor" id="yield"></span><code class="ddoc_psymbol">yield</code><span class="template_param_list" title="Template parameter list">(T)</span>(ref T <code class="ddoc_param">value</code>);
<br><br>void <span class="def-anchor" id="yield"></span><code class="ddoc_psymbol">yield</code><span class="template_param_list" title="Template parameter list">(T)</span>(T <code class="ddoc_param">value</code>);
<br></div></dt>
<dd><div class="summary">Yields a value of type T to the caller of the currently executing
generator.
</div><div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">T <code class="ddoc_param">value</code></td>
<td class="param_desc">The value to yield.</td></tr>
</table></div></div>
<span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples"><pre class="d_code notranslate"><span class="d_keyword">import</span> std.range;
InputRange!<span class="d_keyword">int</span> myIota = iota(10).inputRangeObject;
myIota.popFront();
myIota.popFront();
writeln(myIota.moveFront); <span class="d_comment">// 2
</span>writeln(myIota.front); <span class="d_comment">// 2
</span>myIota.popFront();
writeln(myIota.front); <span class="d_comment">// 3
</span>
<span class="d_comment">//can be assigned to std.range.interfaces.InputRange directly
</span>myIota = <span class="d_keyword">new</span> Generator!<span class="d_keyword">int</span>(
{
<span class="d_keyword">foreach</span> (i; 0 .. 10) <span class="d_psymbol">yield</span>(i);
});
myIota.popFront();
myIota.popFront();
writeln(myIota.moveFront); <span class="d_comment">// 2
</span>writeln(myIota.front); <span class="d_comment">// 2
</span>myIota.popFront();
writeln(myIota.front); <span class="d_comment">// 3
</span>
size_t[2] counter = [0, 0];
<span class="d_keyword">foreach</span> (i, unused; myIota) counter[] += [1, i];
<span class="d_keyword">assert</span>(myIota.empty);
writeln(counter); <span class="d_comment">// [7, 21]
</span></pre>
</div></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".initOnce"></span><div class="quickindex" id="quickindex.initOnce"></div>ref auto <span class="def-anchor" id="initOnce"></span><code class="ddoc_psymbol">initOnce</code><span class="template_param_list" title="Template parameter list">(alias var)</span>(lazy typeof(var) <code class="ddoc_param">init</code>);
<br></div></dt>
<dd><div class="summary">Initializes <span class="d_param">var</span> with the lazy <span class="d_param">init</span> value in a
thread-safe manner.
</div><div class="description">The implementation guarantees that all threads simultaneously calling
initOnce with the same <span class="d_param">var</span> argument block until <span class="d_param">var</span> is
fully initialized. All side-effects of <span class="d_param">init</span> are globally visible
afterwards.
</div>
<div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">var</td>
<td class="param_desc">The variable to initialize</td></tr>
<tr class="param"><td class="param_id">typeof(var) <code class="ddoc_param">init</code></td>
<td class="param_desc">The lazy initializer value</td></tr>
</table></div></div>
<div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">A reference to the initialized variable</div></div>
<span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples">A typical use-case is to perform lazy but thread-safe initialization.
<pre class="d_code notranslate"><span class="d_keyword">static</span> <span class="d_keyword">class</span> MySingleton
{
<span class="d_keyword">static</span> MySingleton instance()
{
<span class="d_keyword">__gshared</span> MySingleton inst;
<span class="d_keyword">return</span> <span class="d_psymbol">initOnce</span>!inst(<span class="d_keyword">new</span> MySingleton);
}
}
<span class="d_keyword">assert</span>(MySingleton.instance !<span class="d_keyword">is</span> <span class="d_keyword">null</span>);
</pre>
</div></div>
</dd>
<dt class="d_decl"><div ><span class="def-anchor" id=".initOnce.2"></span><div class="quickindex" id="quickindex.initOnce.2"></div>ref auto <span class="def-anchor" id="initOnce"></span><code class="ddoc_psymbol">initOnce</code><span class="template_param_list" title="Template parameter list">(alias var)</span>(lazy typeof(var) <code class="ddoc_param">init</code>, shared Mutex <code class="ddoc_param">mutex</code>);
<br><br>ref auto <span class="def-anchor" id="initOnce"></span><code class="ddoc_psymbol">initOnce</code><span class="template_param_list" title="Template parameter list">(alias var)</span>(lazy typeof(var) <code class="ddoc_param">init</code>, Mutex <code class="ddoc_param">mutex</code>);
<br></div></dt>
<dd><div class="summary">Same as above, but takes a separate mutex instead of sharing one among
all initOnce instances.
</div><div class="description">This should be used to avoid dead-locks when the <span class="d_param">init</span>
expression waits for the result of another thread that might also
call initOnce. Use with care.
</div>
<div class="keyval Parameters"><span class="key keyParameters">Parameters:</span> <div class="val valParameters"><table class="params"><tr class="param"><td class="param_id">var</td>
<td class="param_desc">The variable to initialize</td></tr>
<tr class="param"><td class="param_id">typeof(var) <code class="ddoc_param">init</code></td>
<td class="param_desc">The lazy initializer value</td></tr>
<tr class="param"><td class="param_id">Mutex <code class="ddoc_param">mutex</code></td>
<td class="param_desc">A mutex to prevent race conditions</td></tr>
</table></div></div>
<div class="keyval Returns"><span class="key keyReturns">Returns:</span> <div class="val valReturns">A reference to the initialized variable</div></div>
<span class="dlang_runnable"></span><div class="keyval Examples"><span class="key keyExamples">Examples:</span> <div class="val valExamples">Use a separate mutex when init blocks on another thread that might also call initOnce.
<pre class="d_code notranslate"><span class="d_keyword">import</span> core.sync.<span class="d_param">mutex</span> : Mutex;
<span class="d_keyword">static</span> <span class="d_keyword">shared</span> <span class="d_keyword">bool</span> varA, varB;
<span class="d_keyword">static</span> <span class="d_keyword">shared</span> Mutex m;
m = <span class="d_keyword">new</span> <span class="d_keyword">shared</span> Mutex;
spawn({
<span class="d_comment">// use a different mutex for varB to avoid a dead-lock
</span> <span class="d_psymbol">initOnce</span>!varB(<span class="d_keyword">true</span>, m);
ownerTid.send(<span class="d_keyword">true</span>);
});
<span class="d_comment">// init depends on the result of the spawned thread
</span><span class="d_psymbol">initOnce</span>!varA(receiveOnly!<span class="d_keyword">bool</span>);
writeln(varA); <span class="d_comment">// true
</span>writeln(varB); <span class="d_comment">// true
</span></pre>
</div></div>
</dd>
</dl>
<div class="smallprint" id="copyright">Copyright &copy; 1999-2026 by the <a href="../foundation_overview.html">D Language Foundation</a> | Page generated by
<a href="../spec/ddoc.html">Ddoc</a> on Mon Oct 26 00:37:59 2026
</div>
</div>
</div>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script type="text/javascript">window.jQuery || document.write('\x3Cscript src="../js/jquery-3.7.1.min.js">\x3C/script>');</script>
<script type="text/javascript" src="../js/dlang.js"></script>
<script type="text/javascript" src="../js/codemirror-compressed.js"></script>
<script type="text/javascript" src="../js/run.js"></script>
<script type="text/javascript" src="../js/run_examples.js"></script>
<script type="text/javascript" src="../js/listanchors.js"></script>
<script type="text/javascript" src="../js/show_contributors.js"></script>
<script type="text/javascript">jQuery(document).ready(listanchors);</script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
</body>
</html>