Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
506e48c9
Commit
506e48c9
authored
9 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Added Queue.owner property (bool, true if current thread is creator of queue).
parent
d7e568e5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/js_queue.c
+9
-1
9 additions, 1 deletion
src/sbbs3/js_queue.c
with
9 additions
and
1 deletion
src/sbbs3/js_queue.c
+
9
−
1
View file @
506e48c9
...
...
@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright
2011
Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright Rob Swindell - http://www.synchro.net/copyright.html
*
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
...
...
@@ -274,6 +274,7 @@ enum {
,
QUEUE_PROP_DATA_WAITING
,
QUEUE_PROP_READ_LEVEL
,
QUEUE_PROP_WRITE_LEVEL
,
QUEUE_PROP_OWNER
};
#ifdef BUILD_JSDOCS
...
...
@@ -282,6 +283,7 @@ static char* queue_prop_desc[] = {
,
"<i>true</i> if data is waiting to be read from queue"
,
"number of values in the read queue"
,
"number of values in the write qeueue"
,
"<i>true</i> if current thread is the owner/creator of the queue"
,
NULL
};
#endif
...
...
@@ -319,6 +321,11 @@ static JSBool js_queue_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
*
vp
=
INT_TO_JSVAL
(
msgQueueWriteLevel
(
q
));
JS_RESUMEREQUEST
(
cx
,
rc
);
break
;
case
QUEUE_PROP_OWNER
:
rc
=
JS_SUSPENDREQUEST
(
cx
);
*
vp
=
BOOLEAN_TO_JSVAL
(
INT_TO_BOOL
(
msgQueueOwner
(
q
)));
JS_RESUMEREQUEST
(
cx
,
rc
);
break
;
}
return
(
JS_TRUE
);
}
...
...
@@ -332,6 +339,7 @@ static jsSyncPropertySpec js_queue_properties[] = {
{
"data_waiting"
,
QUEUE_PROP_DATA_WAITING
,
QUEUE_PROP_FLAGS
,
312
},
{
"read_level"
,
QUEUE_PROP_READ_LEVEL
,
QUEUE_PROP_FLAGS
,
312
},
{
"write_level"
,
QUEUE_PROP_WRITE_LEVEL
,
QUEUE_PROP_FLAGS
,
312
},
{
"owner"
,
QUEUE_PROP_OWNER
,
QUEUE_PROP_FLAGS
,
316
},
{
0
}
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment