mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Removed unused files.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2532 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3d87da3f3c
commit
1780b2805c
11 changed files with 15 additions and 152 deletions
|
@ -136,7 +136,8 @@ LoadMe_RESOURCE_DIRS = English.lproj
|
|||
SRCS = $(TOOL_NAME:=.m)
|
||||
|
||||
HDRS = \
|
||||
server.h
|
||||
server.h \
|
||||
oldserver.h
|
||||
|
||||
DYNAMIC_MFILES = \
|
||||
LoadMe.m \
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
//
|
||||
// Philosopher.h
|
||||
//
|
||||
// A class of hungry philosophers
|
||||
//
|
||||
|
||||
#include <Foundation/NSLock.h>
|
||||
#include <Foundation/NSThread.h>
|
||||
|
||||
// Conditions
|
||||
#define NO_FOOD 1
|
||||
#define FOOD_SERVED 2
|
||||
|
||||
@interface Philosopher : NSObject
|
||||
|
||||
{
|
||||
int chair;
|
||||
}
|
||||
|
||||
// Instance methods
|
||||
- (void)sitAtChair:(int)position;
|
||||
- (int)chair;
|
||||
|
||||
@end
|
|
@ -1,61 +0,0 @@
|
|||
//
|
||||
// Philosopher.h
|
||||
//
|
||||
// A class of hungry philosophers
|
||||
//
|
||||
|
||||
#include "Philosopher.h"
|
||||
|
||||
extern id forks[5];
|
||||
|
||||
@implementation Philosopher
|
||||
|
||||
// Instance methods
|
||||
- (void)sitAtChair:(int)position
|
||||
{
|
||||
int i;
|
||||
|
||||
// Sit down
|
||||
chair = position;
|
||||
|
||||
// Its a constant battle to feed yourself
|
||||
while (1)
|
||||
{
|
||||
// Get the fork to our left
|
||||
[forks[chair] lockWhenCondition:FOOD_SERVED];
|
||||
|
||||
// Get the fork to our right
|
||||
[forks[(chair + 1) % 5] lockWhenCondition:FOOD_SERVED];
|
||||
|
||||
// Start eating!
|
||||
printf("Philosopher %d can start eating.\n", chair);
|
||||
|
||||
for (i = 0;i < 100000; ++i)
|
||||
{
|
||||
if ((i % 10000) == 0)
|
||||
printf("Philosopher %d is eating.\n", chair);
|
||||
}
|
||||
|
||||
// Done eating
|
||||
printf("Philosopher %d is done eating.\n", chair);
|
||||
|
||||
// Drop the fork to our left
|
||||
[forks[chair] unlock];
|
||||
|
||||
// Drop the fork to our right
|
||||
[forks[(chair + 1) % 5] unlock];
|
||||
|
||||
// Wait until we are hungry again
|
||||
for (i = 0;i < 1000000 * (chair + 1); ++i) ;
|
||||
}
|
||||
|
||||
// We never get here, but this is what we should do
|
||||
[NSThread exit];
|
||||
}
|
||||
|
||||
- (int)chair
|
||||
{
|
||||
return chair;
|
||||
}
|
||||
|
||||
@end
|
|
@ -1,10 +0,0 @@
|
|||
#include <objc/objc-api.h>
|
||||
#include <objc/Object.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main ()
|
||||
{
|
||||
id o = [Object new];
|
||||
printf ("Hello from object at 0x%x\n", (unsigned)[o self]);
|
||||
exit (0);
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
#include <Foundation/NSArchiver.h>
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSString.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
id a = [NSArray arrayWithObjects:
|
||||
[NSObject class],
|
||||
[NSArray class],
|
||||
nil];
|
||||
[NSArchiver archiveRootObject:a toFile:@"./nsarchiving.data"];
|
||||
[a release];
|
||||
|
||||
/* NSUnarchiver not available yet. */
|
||||
|
||||
exit (0);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue