Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clean-libraries
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
clean-and-itasks
clean-libraries
Commits
beadb2a7
Commit
beadb2a7
authored
Jun 08, 2007
by
Rinus Plasmeijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
05aa205d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
1 deletion
+53
-1
libraries/CleanServer/Semaphore.dcl
libraries/CleanServer/Semaphore.dcl
+6
-0
libraries/CleanServer/Semaphore.icl
libraries/CleanServer/Semaphore.icl
+46
-0
libraries/CleanServer/httpSubServer.dcl
libraries/CleanServer/httpSubServer.dcl
+1
-1
No files found.
libraries/CleanServer/Semaphore.dcl
0 → 100644
View file @
beadb2a7
definition
module
Semaphore
CreateSemaphore
::
!
Int
!
Int
!
Int
!{#
Char
}
!*
World
->
(!
Int
,!*
World
);
WaitForSingleObject
::
!
Int
!
Int
!*
World
->
(!
Int
,!*
World
);
ReleaseSemaphore
::
!
Int
!
Int
!
Int
!*
World
->
(!
Int
,!*
World
);
CloseHandle
::
!
Int
!*
World
->
(!
Int
,!*
World
);
libraries/CleanServer/Semaphore.icl
0 → 100644
View file @
beadb2a7
implementation
module
Semaphore
;
import
StdEnv
;
INFINITE
:==
-1
;
// add CreateSemaphoreA@16 and ReleaseSemaphore@12 to kernel_library for Clean 2.2 and older
CreateSemaphore
::
!
Int
!
Int
!
Int
!{#
Char
}
!*
World
->
(!
Int
,!*
World
);
CreateSemaphore
semaphoreAttributes
initialCount
maximumCount
name
world
=
code {
ccall
CreateSemaphoreA@16
"PIIIs:I:A"
}
WaitForSingleObject
::
!
Int
!
Int
!*
World
->
(!
Int
,!*
World
);
WaitForSingleObject
handle
milliseconds
world
=
code {
ccall
WaitForSingleObject@8
"PII:I:A"
}
ReleaseSemaphore
::
!
Int
!
Int
!
Int
!*
World
->
(!
Int
,!*
World
);
ReleaseSemaphore
semaphore
releaseCount
previousCount_p
world
=
code {
ccall
ReleaseSemaphore@12
"PIII:I:A"
}
CloseHandle
::
!
Int
!*
World
->
(!
Int
,!*
World
);
CloseHandle
handle
world
=
code {
ccall
CloseHandle@4
"PI:I:A"
}
Start
w
#
semaphore_name
=
"MySemaphoreName"
;
#
(
semaphore
,
world
)
=
CreateSemaphore
0
1
1
semaphore_name
w
;
|
semaphore
==
0
=
abort
"CreateSemaphore failed"
;
#
(
r
,
world
)
=
WaitForSingleObject
semaphore
INFINITE
world
;
#
(
stdout
,
world
)
=
stdio
world
;
#
(
ok
,
c
,
stdout
)
=
freadc
stdout
;
#
(
ok
,
world
)
=
fclose
stdout
world
;
#
(
ok
,
world
)
=
ReleaseSemaphore
semaphore
1
0
world
;
#
(
ok
,
world
)
=
CloseHandle
semaphore
world
;
|
ok
==
0
=
abort
"CloseHandle failed"
;
libraries/CleanServer/httpSubServer.dcl
View file @
beadb2a7
...
...
@@ -16,7 +16,7 @@ import httpUtil
::
Socket
:==
Int
;
//required functions
RegisterSubProcToServer
::
!
Int
!
Int
!
Int
!
String
!
String
->
Int
RegisterSubProcToServer
::
!
Int
!
Int
!
Int
!
String
!
String
->
Int
// priority minimum maximum number of subservers
WaitForMessageLoop
::
([
String
]
Int
Socket
*
World
->
(
Socket
,*
World
))
Socket
!*
World
->
*
World
//helper-functions for sending (suggested to use one of these)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment