"Matthew Heaney" a �crit dans le message news: u41cg9jaqnrs56@corp.supernews.com... > > "Nick Roberts" wrote in message > news:a1o2h1$sfe3f$5@ID-25716.news.dfncis.de... > > However, really, a much better design is like this: > > No, because protected operations can't make blocking calls. > > Note that all predefined I/O packages are "potentially blocking," which > means, for example, that you can't call Text_IO from inside a protected > object. > > So you still need a semaphore-style type (as in the original post), to > handle the situation in which blocking calls are made inside a critical > section. The technique shown using a Limited_Controlled type to > automatically seize and release the semaphore is a standard Ada95 idiom. > Have a look at package Protection from Adalog's components page (http://www.adalog.fr/compo2.htm) for a component that automates this idiom. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr