Spinroot

A forum for Spin users

You are not logged in.

#1 2019-12-04 20:20:37

Maxvonhippel
Member
Registered: 2019-09-13
Posts: 13

[SOLVED] "While not timeout" option?

Hi,

I have in the past written code much like this:

if
:: timeout -> skip;
:: someChan ! someMsg;
fi
if
:: timeout -> skip;
:: someChan ? someOtherMsg;
fi
... etc etc

Is there any way to do this with some sort of while-guard, like

while (! timeout) {
  send and receive stuff
} else {
   handle the fact that you've timed out / reached what would otherwise be a deadlock
}

?  Thank you!

Last edited by Maxvonhippel (2020-01-13 17:50:24)

Offline

#2 2019-12-04 23:35:49

spinroot
forum
Registered: 2010-11-18
Posts: 664
Website

Re: [SOLVED] "While not timeout" option?

you can use an unless statement?

Offline

#3 2019-12-05 17:53:54

Maxvonhippel
Member
Registered: 2019-09-13
Posts: 13

Re: [SOLVED] "While not timeout" option?

Fantastic, thank you!  I had totally forgotten about those.

Offline

#4 2019-12-05 17:55:13

Maxvonhippel
Member
Registered: 2019-09-13
Posts: 13

Re: [SOLVED] "While not timeout" option?

By the way, the -e flag is undocumented under -run when you do spin --.  I know it's documented under ./pan but it would be useful for new users to also include it under -run in the spin -- output.

I'm happy to cut a pull request on github to do this, if you'd like.  Is that the preferred way to contribute?  Or would you prefer to just add it yourself, or is there some other process I should go through?

Offline

#5 2019-12-05 18:13:42

spinroot
forum
Registered: 2010-11-18
Posts: 664
Website

Re: [SOLVED] "While not timeout" option?

but there are a ton of other options that ./pan recognizes -- it would be hard to list them all ...

Offline

Board footer

Powered by FluxBB