🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.oop.powerplant
Article #31

What am I missing?

#31
From: Frank Pollard
Date: Mon, 17 Sep 2001 03:11
54 lines
2420 bytes
I re-read the relevant parts of PP Advanced Topics.

> You cannot instantiate an LThread object directly, because LThread
> is an abstract class. You must instantiate objects based on a class
> derived from LThread. This might be LSimpleThread, or a thread
> class of your own design.

And I subclassed LThread in my own class, but now I'm getting
threadProtocolErr (-619), at line 787 of LThread.cp. Which is this:

	if (inFlags & threadOption_Main)
	{
		// The user is creating the main thread.

		// This thread is handled specially, since it already exists when the
		// application starts executing.

		// we can't have a preemptive main thread, nor two main threads!
		if (inPreemptive || (sMainThread != NULL) || sInited)
			Throw_(threadProtocolErr);


Here's my code, what am I doing wrong?

#include <LThread.h>

class http : public LThread {
	public:
				http();
		
	protected:
		virtual void *		Run( void );

};



#include "http.h"

http::http()
	: LThread(	false, thread_DefaultStack, LThread::threadOption_Default, nil)
{
}

void*
http::Run( void )
{
	SysBeep(5);
	return nil;
}



UMainThread gets created in main(), right before theApp.Run() is called.
Technical Details
Message-ID: <3BA569E4.471E1531@macman.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!195.54.122.107!newsfeed1.bredband.com!bredband!newsfeed.sovam.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail
References: <3BA3B513.CFA6F0D7@macman.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10bcce,269acb88f4c53044
X-Google-Attributes: gid10bcce,public
X-Google-Thread: f7f77,269acb88f4c53044
X-Google-Attributes: gidf7f77,public
X-Google-ArrivalTime: 2001-09-16 20:12:22 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!195.54.122.107!newsfeed1.bredband.com!bredband!newsfeed.sovam.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail
Message-ID: <3BA569E4.471E1531@macman.net>
From: Frank Pollard <macman@macman.net>
Reply-To: macman@macman.net
X-Mailer: Mozilla 4.61 (Macintosh; I; PPC)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.sys.mac.oop.powerplant,codewarrior.mac
Subject: What am I missing?
References: <3BA3B513.CFA6F0D7@macman.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 54
Date: Sun, 16 Sep 2001 23:11:32 -0400
NNTP-Posting-Host: 64.229.104.200
X-Complaints-To: abuse@sympatico.ca
X-Trace: news20.bellglobal.com 1000696335 64.229.104.200 (Sun, 16 Sep 2001 23:12:15 EDT)
NNTP-Posting-Date: Sun, 16 Sep 2001 23:12:15 EDT
Organization: Bell Sympatico