2015-06-29 19:43:15 -04:00
|
|
|
USING: concurrency.futures kernel tools.test threads ;
|
|
|
|
IN: concurrency.futures.tests
|
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ 50 } [
|
2015-06-29 19:43:15 -04:00
|
|
|
[ 50 ] future ?future
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
[
|
2015-07-02 13:34:01 -04:00
|
|
|
[ "this should propogate" throw ] future ?future
|
2015-06-29 19:43:15 -04:00
|
|
|
] must-fail
|
|
|
|
|
2015-07-03 12:39:59 -04:00
|
|
|
{ } [
|
2015-07-02 13:34:01 -04:00
|
|
|
[ "this should not propogate" throw ] future drop
|
2015-06-29 19:43:15 -04:00
|
|
|
] unit-test
|
|
|
|
|
|
|
|
! Race condition with futures
|
2015-07-03 12:39:59 -04:00
|
|
|
{ 3 3 } [
|
2015-06-29 19:43:15 -04:00
|
|
|
[ 3 ] future
|
|
|
|
dup ?future swap ?future
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
! Another race
|
2015-07-03 12:39:59 -04:00
|
|
|
{ 3 } [
|
2015-06-29 19:43:15 -04:00
|
|
|
[ 3 yield ] future ?future
|
|
|
|
] unit-test
|