Boost logo

Boost :

From: williamkempf_at_[hidden]
Date: 2001-06-27 14:53:14


--- In boost_at_y..., Beman Dawes <bdawes_at_a...> wrote:
> At 03:06 PM 6/27/2001, williamkempf_at_h... wrote:
>
> >Interface 2:
> >
> >namespace thread
> >{
> > class ref
> > {
> > public:
> > ref();
> > ref(const ref& other);
> > ~ref();
> >
> > ref& swap(const ref& other);
> > ref& operator=(const ref& other);
> >
> > bool operator==(const ref& other) const;
> > bool operator!=(const ref& other) const;
> >
> > bool is_current() const;
> > bool is_alive() const;
> >
> > void join();
> > };
> >
> > ref create(detail::threadproc proc);
> > void sleep(const xtime& xt);
> > void yield();
> >}
>
> Is there a reason for not having a creating constructor?
>
> ref(detail::threadproc proc); // calls thread::create()
>
> Without having put a lot of thought into it, that would seem to be
an
> ease-of-use enhancement.

None other than it blurs the distinction between the ref and the
(implementation hidden) thread concepts, much as the original design
did.

Bill Kempf


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk