Changeset a59e338 for doc/theses/colby_parsons_MMAth/text
- Timestamp:
- Jul 22, 2023, 8:51:46 AM (21 months ago)
- Branches:
- master
- Children:
- 378096a
- Parents:
- f898983
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified doc/theses/colby_parsons_MMAth/text/waituntil.tex ¶
rf898983 ra59e338 472 472 or waituntil( i << C2 ) {} 473 473 or waituntil( i << C3 ) {} 474 or waituntil( min( timeout( D1 ), timeout( D2 ), timeout( D3) ) {}474 or waituntil( timeout( min( D1, D2, D3 ) ) ) {} 475 475 476 476 … … 478 478 \end{tabular} 479 479 \end{cquote} 480 These examples are basically equivalent.480 These two examples are basically equivalent. 481 481 Here, the multiple timeouts are useful because the durations can change during execution and the separate clauses provide different code blocks if a timeout triggers. 482 482 Multiple timeouts can also be used with @and@ to provide a minimal delay before proceeding. 483 In following example, either channel s @C1@ or @C2@ must be satisfied but nothing can be done for at least 1 or 3 seconds after the channel read.483 In following example, either channel @C1@ or @C2@ must be satisfied but nothing can be done for at least 1 or 3 seconds after the channel read, respctively. 484 484 \begin{cfa}[deletekeywords={timeout}] 485 485 waituntil( i << C1 ); and waituntil( timeout( 1`s ) ); 486 486 or waituntil( i << C2 ); and waituntil( timeout( 3`s ) ); 487 487 \end{cfa} 488 If only @C2@ is satisfied, \emph{both} timeout code-blocks trigger .488 If only @C2@ is satisfied, \emph{both} timeout code-blocks trigger because 1 second ocurs before 3 seconds. 489 489 Note, the \CFA @waitfor@ statement only provides a single @timeout@ clause because it only supports @or@ semantics. 490 490
Note: See TracChangeset
for help on using the changeset viewer.