1
0
mirror of https://github.com/janet-lang/janet synced 2024-09-29 23:40:40 +00:00
Commit Graph

2013 Commits

Author SHA1 Message Date
llmII
95891eb0a5
Fix incorrect use of EV_SET on pipes (part 2)
Forgot that we use nearly the same routine for adding and deletion...
can't go around deleting things we haven't put into the changeset!
2021-09-03 22:33:28 -05:00
llmII
c133443eb7
Fix incorrect use of EV_SET on pipes.
It would seem adding a read and a write event filter on a pipe which is
unidirectional might just be a bad idea.
2021-09-03 19:44:27 -05:00
llmII
8f0641f36c
Disabling superfluous code
The code in question may be checking things in an erroneous manner?
2021-09-03 17:18:40 -05:00
llmII
f48dbde736
Better exit (error?) message
The prior calls to exit(-1) were wrong anyway and they may at this point
be hindering figuring out what's going on in suite 9.
2021-09-03 17:13:54 -05:00
llmII
f2e4c1ae9a
Forgot a semicolon... 2021-09-03 16:31:20 -05:00
llmII
a4aef38cc0
More typo and syntax fixes. 2021-09-03 16:29:39 -05:00
llmII
b445ecde51
Add kqueue option to meson, janetconf, fix typoes 2021-09-03 16:23:15 -05:00
llmII
a209a01284
Add kqueue support to Janet
Note that this is a work in progress and simply a first attempt at
getting some code into place before being able to test it. This code
follows of sorts both the poll and epoll sections of the codebase hoping
to achieve the exact same.
2021-09-03 14:33:47 -05:00
Calvin Rose
7037532943 Errored threads always emit stacktrace or supervisor event.
That way, it is much harder to swallow errors. Error swallowing behavior
would have to be done explicitly by wrapping fibers with `protect` or
`try`.
2021-09-01 21:05:05 -05:00
Calvin Rose
bb405ee1aa Address #778
Relax check that number of closure environments in a function matches
that of the def.

The def could be partially constructed, and so there may be a false
negative. The runtime will check that this is consistent, and the
garbage collector should handle when this constraint is not kept.
2021-08-31 22:58:44 -05:00
Calvin Rose
ef23356309 Threaded supervisors return fiber->last_value instead
of the fiber itself.
2021-08-31 14:50:27 -05:00
Calvin Rose
5464a7a379 Allow passing a function to directly to ev/go.
Makes ev/call less useful but ev/go more useful. No need
to construct as many identical intermediate fibers.
2021-08-30 22:22:22 -05:00
Calvin Rose
acbebc5631 Allow passing function to ev/thread.
Convenient when there is no need to create an entire fiber.
2021-08-30 22:04:15 -05:00
Calvin Rose
e1c4fc29de Prepare for 1.17.1 release. 2021-08-29 11:29:41 -05:00
Calvin Rose
b903433284 Merge branch 'master' of github.com:janet-lang/janet 2021-08-29 11:15:43 -05:00
Calvin Rose
9909adb665 Remove JANER_HEADERPATH from boot process.
That is a jpm thing.
2021-08-29 10:43:58 -05:00
Josef Pospíšil
29ea408980 Fix spawn-thread doc about its return 2021-08-28 15:39:49 +02:00
Josef Pospíšil
0bb7ca7441 Fix typos in ev/go ev/select 2021-08-28 15:35:55 +02:00
Calvin Rose
a992644c62 Merge branch 'master' of github.com:janet-lang/janet 2021-08-27 11:52:19 -05:00
Calvin Rose
1c15926e6f Fix #773 - fix docstring. 2021-08-27 11:52:03 -05:00
Calvin Rose
ab740f92db Fix ev thread swallowing error in some case. 2021-08-27 11:46:42 -05:00
sogaiu
1d7390fa7c Tweak fiber/last-value docstring 2021-08-27 17:29:20 +09:00
Calvin Rose
0ab96b8e47 Fix #771 2021-08-26 22:23:21 -05:00
bakpakin
7734e77dfc Readd the janet_register function. 2021-08-22 10:38:15 -05:00
Calvin Rose
257c8b65c2 Fix destruction order. 2021-08-21 13:30:09 -05:00
Calvin Rose
846c9e5e12 Fix #759 - Add -E flag for one-liners.
Use the `short-fn` DSL here for argument passing.
2021-08-21 13:16:41 -05:00
Calvin Rose
685d2b460c Address #765. Make assert into a macro. 2021-08-21 12:27:58 -05:00
Calvin Rose
bd71e1cd02 Silence clang warning about comparing function pointers.
The comparison is used to create a set of function pointers.
2021-08-21 12:10:19 -05:00
Calvin Rose
49142fa385 Update for windows compiler warning. 2021-08-20 19:48:48 -05:00
Calvin Rose
d631d29cb4 Fix typo in header. 2021-08-20 18:53:22 -05:00
Calvin Rose
01b7891347 Windows header issues. 2021-08-20 18:49:13 -05:00
Calvin Rose
c786a4cbeb Expose JanetOSMutex to make abstract types easier to write. 2021-08-20 17:57:23 -05:00
Calvin Rose
1920ecd668 Decrement thread channel pointer during cleanup without adding to heap. 2021-08-20 16:41:19 -05:00
Calvin Rose
c8827424e7 Fix memory leak and use after free
Use after free was caused by missing janet_gcroot call when
setting up thread.
2021-08-19 21:51:53 -05:00
Calvin Rose
cc066dd6a1 Add basic runtime support for threaded abstracts.
A threaded abstract is an abstract type that can be freely shared
between threads. While no synchronization is provided, refcounting
and transport between threads is. This will let implementers more easily
exploit OS-level parallelism in C library code. The caveat with these
types is that they need to be careful in how they interact with objects
on other heaps.
2021-08-19 21:16:20 -05:00
Calvin Rose
eb0b37f729 Initial threaded abstract types. 2021-08-19 20:56:48 -05:00
Calvin Rose
e552757edc Fix threaded supervisor channels - Fix #766
Some pointer casting with abstract types was incorrect, resulting
in strange behavior when trying to use supervisor channels that were
threaded. This fix also adds the ability to supply a supervisor channel
directly when creating a thread.
2021-08-16 21:14:06 -05:00
Calvin Rose
87b8dffe23 Deprecate the thread module. 2021-08-15 17:36:47 -05:00
Calvin Rose
81b5904188 Add marshal/unmarshal to items pushed to threaded channel. 2021-08-15 16:12:40 -05:00
Calvin Rose
894a3b2fe2 Fix memory leak with threaded channels. 2021-08-15 15:33:26 -05:00
Calvin Rose
b75b3e3984 Working example for threaded channels.
Still no marshalling more complex values.
2021-08-15 15:25:07 -05:00
Calvin Rose
dea4906144 Merge branch 'master' of github.com:janet-lang/janet 2021-08-15 13:15:41 -05:00
Calvin Rose
97e5117a3f Fix some issues and improve channel closing.
Still not fully working, seems to be deadlock/channel issue when
sending events between threads.
2021-08-15 13:14:33 -05:00
Calvin Rose
037215f7c4 Initial working draft of threaded channels.
Introduces close semtantics to channels as well, but otherwise
threaded channels behave much like non-threaded channels. They have
different marshalling behavior though, and can only send values over by
packing and unpacking them. For now, this means only primitive values
although this will be expanded.

Also missing some implementation for closing threaded channels, and a
whole lot of testing. Achtung!, Caveat emptor, here be dragons and bugs.
2021-08-15 11:48:13 -05:00
Calvin Rose
0277187fde
Merge pull request #763 from sogaiu/rng-uniform-doc-tweak
Tweak docstring for math/rng-uniform
2021-08-14 19:10:45 -05:00
sogaiu
c80a3c1401 Fix error 2021-08-15 06:57:46 +09:00
sogaiu
1a3c8692e6 Tweak docstring for math/rng-uniform 2021-08-10 20:09:24 +09:00
Andrew Chambers
f2e8691ad5 Fix init race for environ lock. 2021-08-09 14:47:41 +12:00
Calvin Rose
c94d7574bc
Merge pull request #754 from harryvederci/patch-1
Improve docstring for the invert function.
2021-08-08 12:51:24 -05:00
Calvin Rose
a38cb5df18
Merge pull request #757 from subsetpark/document-match
Add documentation of @ pattern in match
2021-08-08 12:51:00 -05:00
Zach Smith
5407868620 Add documentation of @ pattern in match 2021-08-07 15:09:37 -04:00
Harry Prins
7edf77561b
Refer to argument. Change past tense to present. 2021-08-07 18:03:10 +02:00
Calvin Rose
a78cbd91da Address #753 - fix gensym regression. 2021-08-06 16:25:53 -05:00
Calvin Rose
bb5c3773f1 Fix fiber aware combinators to use general iteration instead of fiber
specifics.
2021-08-06 16:17:47 -05:00
Calvin Rose
2e641a266d
Merge pull request #752 from sogaiu/get-in-tweak
Tweak get-in behavior
2021-08-06 15:14:33 -05:00
Zach Smith
34019222c2 Make take/take-while/take-until fiber-aware 2021-08-06 15:40:29 -04:00
Harry Prins
5f3378213b
Improve docstring for the invert function. 2021-08-06 18:33:49 +02:00
sogaiu
2080ac3bda Tweak get-in behavior 2021-08-06 08:24:26 +09:00
Damien Ready
934e091410 Note "int" vs "double" representation of seconds 2021-07-31 11:02:48 -05:00
Calvin Rose
7f7ee75954 Patch util.c 2021-07-31 10:00:43 -05:00
Calvin Rose
e76b8da269 Add semantics for closing channels.
This makes certain algorithms simpler as channels
now have an explicit lifetime - multiple readers can coordinate
closing without needing to ensure the same number of reads as writes.
2021-07-30 19:26:42 -05:00
Calvin Rose
7e5f226480 Put source mapping info in stack traces. 2021-07-29 21:29:08 -05:00
Calvin Rose
2f634184f0 Merge branch 'master' of github.com:janet-lang/janet 2021-07-28 21:41:34 -05:00
Calvin Rose
e3e01466ee
Merge pull request #741 from sogaiu/remove-duplicate-method
Remove duplicate of method recv-from
2021-07-28 20:35:33 -05:00
sogaiu
025918cfcc Remove duplicate of method recv-from 2021-07-28 14:44:49 +09:00
Calvin Rose
28fb76e602
Merge pull request #740 from yumaikas/hotfix-new-style-math-bindings
Fix macro stringification for one-arg math functions
2021-07-27 23:56:16 -05:00
Andrew Owen
b0f97393a3 Fix macro stringification for one-arg math functions 2021-07-27 21:40:25 -06:00
Calvin Rose
2a7041e751
Merge pull request #739 from sogaiu/new-style-core-fn-decl-for-array
Update array.c with new style core function declarations
2021-07-27 22:37:35 -05:00
sogaiu
eed158afdd
Merge branch 'janet-lang:master' into new-style-core-fn-decl-for-array 2021-07-28 10:24:11 +09:00
Andrew Owen
1c7505e04a
Merge branch 'master' into new-style-math-bindings 2021-07-27 19:19:39 -06:00
Calvin Rose
617da24942
Merge pull request #726 from yumaikas/new-style-ev-bindings
Update ev.c to use the new binding style that provides source information
2021-07-27 20:17:19 -05:00
Andrew Owen
98bdbfd3d5 Add JANET_DEF and co, use in math.c 2021-07-27 19:13:09 -06:00
Andrew Owen
b289f253c7 Remove static function from the JANET_FN family of macros 2021-07-27 18:43:32 -06:00
Andrew Owen
aabae03305 Add rselect bindings 2021-07-27 00:48:28 -06:00
sogaiu
194d645551 Update array.c with new style core function declarations. 2021-07-27 15:34:12 +09:00
Calvin Rose
889d6f9e43
Merge pull request #737 from sogaiu/new-style-core-fn-decl-for-corelib
Update corelib.c with new style core function declarations.
2021-07-26 22:07:17 -05:00
Calvin Rose
151de093d0
Merge pull request #736 from sogaiu/new-style-core-fn-decl-for-debug
Update debug.c with new style core function declarations.
2021-07-26 22:06:17 -05:00
sogaiu
7492a4c871 Update buffer.c with new style core function declarations. 2021-07-27 11:34:03 +09:00
sogaiu
d20543b92c Update corelib.c with new style core function declarations. 2021-07-27 11:18:54 +09:00
sogaiu
59aab2ebbd Update debug.c with new style core function declarations. 2021-07-27 08:01:56 +09:00
Calvin Rose
08f7b1b9e5 Run the formatter. 2021-07-26 17:54:26 -05:00
Calvin Rose
f2ac1c15e6
Merge pull request #735 from sogaiu/new-style-core-fn-decl-for-fiber
Update fiber.c with new style core function declarations.
2021-07-26 17:36:54 -05:00
Calvin Rose
eaf8f198c1
Merge pull request #733 from sogaiu/new-style-core-fn-decl-for-io
Update io.c with new style core function declarations.
2021-07-26 17:36:37 -05:00
sogaiu
2955286606 Update fiber.c with new style core function declarations. 2021-07-27 07:00:59 +09:00
Calvin Rose
40561340a8
Merge pull request #721 from uvtc/patch-1
docs for doc, searching for strings
2021-07-26 15:21:39 -05:00
Calvin Rose
4f00a7db88
Merge pull request #729 from sogaiu/new-style-core-fn-decl-for-os
Update os.c with new style core function declarations.
2021-07-26 15:21:15 -05:00
Calvin Rose
acc21d0b76
Merge pull request #724 from sogaiu/new-style-core-fn-decl-for-thread
Update thread.c with new style core function declarations.
2021-07-26 15:19:19 -05:00
Calvin Rose
db5df70d0c
Merge pull request #727 from sogaiu/new-style-core-fn-decl-for-string
Update string.c with new style core function declarations.
2021-07-26 15:19:07 -05:00
sogaiu
92c132381e Update inttypes.c with new style core function declarations. 2021-07-26 21:52:02 +09:00
sogaiu
d0575e4087 Update io.c with new style core function declarations. 2021-07-26 21:39:13 +09:00
Calvin Rose
5ca48b96af
Merge pull request #728 from sogaiu/new-style-core-fn-decl-for-parse
Update parse.c with new style core function declarations.
2021-07-26 07:22:46 -05:00
Calvin Rose
2a9f30fc8a
Merge pull request #725 from sogaiu/new-style-core-fn-decl-for-table
Update table.c with new style core function declarations.
2021-07-26 07:16:28 -05:00
Calvin Rose
ba89a81a3e
Merge pull request #731 from sogaiu/new-style-core-fn-decl-for-net
Update net.c with new style core function declarations.
2021-07-26 07:11:15 -05:00
sogaiu
15b4d9363b Update marsh.c with new style core function declarations. 2021-07-26 18:29:59 +09:00
sogaiu
ceca0e7f0e Update net.c with new style core function declarations. 2021-07-26 18:20:06 +09:00
Andrew Owen
700770b883 Update math.c for the new style 2021-07-26 01:51:13 -06:00
sogaiu
8365037be5 Update os.c with new style core function declarations. 2021-07-26 16:48:04 +09:00
sogaiu
dfaba7daa6 Update parse.c with new style core function declarations. 2021-07-26 15:42:33 +09:00
sogaiu
5756934144 Update string.c with new style core function declarations. 2021-07-26 15:23:04 +09:00
Andrew Owen
7b3ab2727f Fix copy/paste mistake in ev/take docs 2021-07-26 00:11:05 -06:00