Skip to content

Conversation

@imiklos
Copy link
Contributor

@imiklos imiklos commented Mar 19, 2018

Now the jerry-debugger uses the jerry-port's sleep, therefore if there are systems that don't support
usleep or nanosleep they can now define their own function.

JerryScript-DCO-1.0-Signed-off-by: Istvan Miklos imiklos2@inf.u-szeged.hu

@imiklos imiklos force-pushed the sleep branch 2 times, most recently from 009332f to e78e6c9 Compare March 19, 2018 14:56

#ifdef JERRY_DEBUGGER
#include <jrt.h>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've added this include twice. Remove from here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is jrt.h required in default-date.c at all? that seems like a layering violation to me. if that's only for the sake of uint32_t, there are standard libc headers that could be included.


#ifdef JERRY_DEBUGGER
#include <jrt.h>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is jrt.h required in default-date.c at all? that seems like a layering violation to me. if that's only for the sake of uint32_t, there are standard libc headers that could be included.

*/
#ifdef JERRY_DEBUGGER
void jerry_port_sleep (uint32_t sleep_time);
#endif /* JERRY_DEBUGGER */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is outside the comment group. should be within.

@imiklos
Copy link
Contributor Author

imiklos commented Mar 20, 2018

@robertsipka @akosthekiss Thank you for the reviews. I updated the PR.

Copy link
Contributor

@LaszloLango LaszloLango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs/05.PORT-API.md must be updated as well. I think the new port functions shouldn't be in the default-date.c. It belongs only to the debugger, so It would be better to put it into a new file called jerry-port/default/default-debugger.c

Now the jerry-debugger uses the jerry-port's sleep, therefore if there are systems that don't support
usleep or nanosleep can now define their own function.

JerryScript-DCO-1.0-Signed-off-by: Istvan Miklos imiklos2@inf.u-szeged.hu
@imiklos
Copy link
Contributor Author

imiklos commented Mar 21, 2018

@LaszloLango Thank you for the review. Moved the port function to a new file and updated the docs/05.PORT-API.md.

Copy link
Contributor

@LaszloLango LaszloLango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yichoi
Copy link
Contributor

yichoi commented Mar 22, 2018

LGTM

@yichoi yichoi merged commit 15f6ca9 into jerryscript-project:master Mar 22, 2018
struct jerry_instance_t *jerry_port_get_current_instance (void);

/**
* Makes the process sleep for a given time.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the unit of time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit of time is millisecond.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants