-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sdk mappings for UMTX bug. Update readme with the new IntelliJ setup.
- Loading branch information
Showing
64 changed files
with
2,694 additions
and
73 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.ps5jb.sdk.include; | ||
|
||
import org.ps5jb.sdk.include.sys.ErrNo; | ||
import org.ps5jb.sdk.include.sys.pthreadtypes.PThreadType; | ||
import org.ps5jb.sdk.lib.LibKernel; | ||
|
||
/** | ||
* This class represents <code>include/pthread.h</code> from FreeBSD source. | ||
*/ | ||
public class PThread { | ||
private final LibKernel libKernel; | ||
private final ErrNo errNo; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param libKernel Instance of the 'libkernel' native library wrapper. | ||
*/ | ||
public PThread(LibKernel libKernel) { | ||
this.libKernel = libKernel; | ||
this.errNo = new ErrNo(this.libKernel); | ||
} | ||
|
||
/** | ||
* Get thread ID of the calling thread. | ||
* | ||
* @return Thread ID of the calling thread. | ||
*/ | ||
public PThreadType self() { | ||
return new PThreadType(libKernel.pthread_self()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.ps5jb.sdk.include; | ||
|
||
import org.ps5jb.sdk.core.SdkException; | ||
import org.ps5jb.sdk.core.SdkRuntimeException; | ||
import org.ps5jb.sdk.include.sys.ErrNo; | ||
import org.ps5jb.sdk.include.sys.errno.NotFoundException; | ||
import org.ps5jb.sdk.include.sys.pthreadtypes.PThreadType; | ||
import org.ps5jb.sdk.lib.LibKernel; | ||
|
||
/** | ||
* This class represents <code>include/pthread_np.h</code> from FreeBSD source. | ||
*/ | ||
public class PThreadNp { | ||
private final LibKernel libKernel; | ||
private final ErrNo errNo; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param libKernel Instance of the 'libkernel' native library wrapper. | ||
*/ | ||
public PThreadNp(LibKernel libKernel) { | ||
this.libKernel = libKernel; | ||
this.errNo = new ErrNo(this.libKernel); | ||
} | ||
|
||
/** | ||
* Sets internal name for thread specified by tid argument | ||
* to string value specified by name argument. | ||
* | ||
* @param tid Thread to rename. | ||
* @param name New thread name. | ||
* @throws NotFoundException Thread with given tid not found. | ||
*/ | ||
public void rename(PThreadType tid, String name) throws NotFoundException { | ||
int ret = libKernel.pthread_rename_np(tid.getPthread(), name); | ||
if (ret != 0) { | ||
SdkException ex = errNo.getLastException(getClass(), "pthread_rename_np"); | ||
if (ex instanceof NotFoundException) { | ||
throw (NotFoundException) ex; | ||
} else { | ||
throw new SdkRuntimeException(ex.getMessage(), ex); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.