annotate tests/channelThief.ur @ 2174:ce312cad5ecd

Use correct OpenSSL thread safety macros on OS X (closes #209) Create an Autoconf test to determine if pthread_t is a pointer or scalar type, and use the appropriate CRYPTO_THREADID_set macro based on the result.
author Benjamin Barenblat <bbaren at mit.edu>
date Sun, 20 Sep 2015 17:46:07 -0400
parents a671e5258a2c
children
rev   line source
adam@1942 1 table t : { Ch : channel string }
adam@1942 2
adam@1942 3 fun go () =
adam@1942 4 let
adam@1942 5 fun overwrite () =
adam@1942 6 dml (DELETE FROM t WHERE TRUE);
adam@1942 7 ch <- channel;
adam@1942 8 dml (INSERT INTO t (Ch) VALUES ({[ch]}));
adam@1942 9 return ch
adam@1942 10
adam@1942 11 fun retrieve () =
adam@1942 12 oneRowE1 (SELECT (t.Ch) FROM t)
adam@1942 13
adam@1942 14 fun transmit () =
adam@1942 15 ch <- retrieve ();
adam@1942 16 send ch "Test"
adam@1942 17
adam@1942 18 fun listenOn ch =
adam@1942 19 s <- recv ch;
adam@1942 20 alert s
adam@1942 21 in
adam@1942 22 ch <- overwrite ();
adam@1942 23 return <xml><body onload={listenOn ch}>
adam@1942 24 <button value="overwrite" onclick={fn _ => ch <- rpc (overwrite ()); listenOn ch}/>
adam@1942 25 <button value="retrieve" onclick={fn _ => ch <- rpc (retrieve ()); listenOn ch}/>
adam@1942 26 <button value="transmit" onclick={fn _ => rpc (transmit ())}/>
adam@1942 27 </body></xml>
adam@1942 28 end
adam@1942 29
adam@1942 30 fun main () = return <xml><body>
adam@1942 31 <form><submit action={go}/></form>
adam@1942 32 </body></xml>