[haiku-development] Re: Haiku "Hello, World" tutorial

  • From: "Jonas Sundström" <jonas@xxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 15 Sep 2009 10:13:02 +0200 CEST

Rene Gollent <anevilyak@xxxxxxxxx> wrote:
> On Mon, Sep 14, 2009 at 6:28 PM, Ryan Leavengood <
> leavengood@xxxxxxxxx> wrote:
> > Yeah that makes sense but I'm pretty sure I've seen the PostMessage
> > version used a lot more than the SendMessage one. Maybe we need to
> > update some code then ;)
> 
> Just checked....not sure if this was the case in BeOS or not, but
> Haiku's PostMessage implementation also checks the looper list, which
> I didn't think it did. Ergo, it's just as safe as SendMessage.

Shouldn't intra-thread calls between BLooper threads (BWindow and
BApplication) be wrapped in Lock() and Unlock() in the usual case?

Is there anything wrong about these assumptions?:

- be_app_messenger is called without locking,
being a pointer to a BMessenger

-  be_app being a pointer to a BApplication (a BLooper subclass
and thus running in a thread of its own) is not safe to call
methods on without first locking. (and unlocking afterwards)

/Jonas.


Other related posts: